//*-- Author : R. Lalik //*-- Created : 2017 //_HADES_CLASS_DESCRIPTION ///////////////////////////////////////////////////////////// // HForwardCandSim // // Sim information for track vector // ///////////////////////////////////////////////////////////// #include #include "hforwardcandsim.h" // JAM workaround for ROOT5 on old system #if ROOT_VERSION_CODE >= ROOT_VERSION(6, 0, 0) #include #else #include #endif ClassImp(HForwardCandSim); HForwardCandSim::HForwardCandSim() : fGeantTrackRpc(-1), fGeantPx1(0.0), fGeantPy1(0.0), fGeantPz1(0.0), fGeantPx2(0.0), fGeantPy2(0.0), fGeantPz2(0.0), fGeantX1(0.0), fGeantY1(0.0), fGeantZ1(0.0), fGeantX2(0.0), fGeantY2(0.0), fGeantZ2(0.0) { } void HForwardCandSim::print(UChar_t mask) const { // Print vector simulation parameters if (mask & 0x01) HForwardCand::print(); if (mask & 0x04) { printf(" SIM VECTOR -----\n"); printf(" Entry vector=%f,%f,%f at %f,%f,%f", fGeantPx1, fGeantPy1, fGeantPz1, fGeantX1, fGeantY1, fGeantZ1); printf(" Direction vector=%f,%f at %f,%f,%f\n", getGeantTx(), getGeantTy(), fGeantX1, fGeantY1, fGeantZ1); printf(" Exit vector=%f,%f,%f at %f,%f,%f", fGeantPx2, fGeantPy2, fGeantPz2, fGeantX2, fGeantY2, fGeantZ2); printf(" tracks= "); for (Int_t i = 0; i < getNofHits(); ++i) printf("%2d,", fGeantTrackInds[i]); printf("\n"); } } Int_t HForwardCandSim::calcGeantCorrTrackIds() { #if ROOT_VERSION_CODE >= ROOT_VERSION(6, 0, 0) std::unordered_set tracks(fGeantTrackInds, fGeantTrackInds + getNofHits()); #else std::set tracks(fGeantTrackInds, fGeantTrackInds + getNofHits()); #endif setGeantCorrTrackIds(tracks.size()); return tracks.size(); } void HForwardCandSim::Streamer(TBuffer &R__b) { // Stream an object of class HForwardCandSim. UInt_t R__s, R__c; if (R__b.IsReading()) { Version_t R__v = R__b.ReadVersion(&R__s, &R__c); if (R__v) { } HForwardCand::Streamer(R__b); HVirtualCandSim::Streamer(R__b); R__b >> fGeantTrackRpc; {float R_Dummy; R__b >> R_Dummy; fGeantPx1=Float16_t(R_Dummy);} {float R_Dummy; R__b >> R_Dummy; fGeantPy1=Float16_t(R_Dummy);} {float R_Dummy; R__b >> R_Dummy; fGeantPz1=Float16_t(R_Dummy);} {float R_Dummy; R__b >> R_Dummy; fGeantPx2=Float16_t(R_Dummy);} {float R_Dummy; R__b >> R_Dummy; fGeantPy2=Float16_t(R_Dummy);} {float R_Dummy; R__b >> R_Dummy; fGeantPz2=Float16_t(R_Dummy);} {float R_Dummy; R__b >> R_Dummy; fGeantX1=Float16_t(R_Dummy);} {float R_Dummy; R__b >> R_Dummy; fGeantY1=Float16_t(R_Dummy);} {float R_Dummy; R__b >> R_Dummy; fGeantZ1=Float16_t(R_Dummy);} {float R_Dummy; R__b >> R_Dummy; fGeantX2=Float16_t(R_Dummy);} {float R_Dummy; R__b >> R_Dummy; fGeantY2=Float16_t(R_Dummy);} {float R_Dummy; R__b >> R_Dummy; fGeantZ2=Float16_t(R_Dummy);} R__b.ReadStaticArray((int*)fGeantTrackInds); R__b.CheckByteCount(R__s, R__c, HForwardCandSim::IsA()); } else { R__c = R__b.WriteVersion(HForwardCandSim::IsA(), kTRUE); HForwardCand::Streamer(R__b); HVirtualCandSim::Streamer(R__b); R__b << fGeantTrackRpc; R__b << float(fGeantPx1); R__b << float(fGeantPy1); R__b << float(fGeantPz1); R__b << float(fGeantPx2); R__b << float(fGeantPy2); R__b << float(fGeantPz2); R__b << float(fGeantX1); R__b << float(fGeantY1); R__b << float(fGeantZ1); R__b << float(fGeantX2); R__b << float(fGeantY2); R__b << float(fGeantZ2); R__b.WriteArray(fGeantTrackInds, 16); R__b.SetByteCount(R__c, kTRUE); } }