5 #include "TDirectory.h"
6 #include "TProcessID.h"
12 #include <TStopwatch.h>
21 #ifndef REFLEX_DICTIONARY
92 TStopwatch* mystopw =
new TStopwatch();
95 fTracks =
new TClonesArray(
"WCSimRootTrack", 10000);
96 fTracks->BypassStreamer(kFALSE);
136 TStopwatch* mystopw =
new TStopwatch();
165 if(
this == &in)
return *
this;
174 for(
int j = 0; j < 4; j++) {
248 int64_t date,Int_t subevent)
257 std::vector<Float_t> trigger_info)
261 for(
size_t i = 0; i < trigger_info.size(); i++)
270 Double_t gammaVtx[2][3])
283 Double_t gammaVtx[2][3])
285 for (
int i=0;i<2;i++)
291 for (
int j=0;j<3;j++)
322 TClonesArray &tracks = *
fTracks;
351 Double_t dir[3], pdir[3], stop[3], start[3];
352 for(
int i = 0; i < 3; i++) {
353 dir [i] = track->
GetDir(i);
358 TClonesArray &tracks = *
fTracks;
402 Double_t
time,Int_t
id)
434 for (
unsigned int i =0;i<truetime.size();i++)
444 WC_Index[1] = truetime.size();
479 std::vector<int> photon_ids)
490 return cherenkovdigihit;
508 return cherenkovdigihit;
516 std::vector<int> photon_ids)
553 if (
this == &in)
return *
this;
571 for (
int i = 0 ; i <
fEventList->GetEntriesFast() ; i++) {
572 delete (*fEventList)[i];
608 for(
int i = 0; i < 3; i++) {
609 failed = (!
ComparisonPassed(
fDir[i], c->
GetDir(i),
typeid(*this).name(), __func__, TString::Format(
"%s[%d]",
"Dir", i))) || failed;
611 for(
int i = 0; i < 3; i++) {
614 for(
int i = 0; i < 3; i++) {
617 for(
int i = 0; i < 3; i++) {
633 for(
int i = 0; i < 2; i++) {
682 for(
int i = 0; i < 3; i++) {
685 for(
int i = 0; i < 2; i++) {
688 for(
int i = 0; i < 2; i++) {
691 for(
int i = 0; i < 2; i++) {
692 for(
int j = 0; j < 3; j++) {
712 cerr <<
"WCSimRootTrigger::CompareAllVariables() Different number of tracks: " << this->
GetTracks()->GetEntries() <<
", " << c->
GetTracks()->GetEntries() << endl;
716 cerr <<
"WCSimRootTrigger::CompareAllVariables() Different number of Cherenkov hits: " << this->
GetCherenkovHits()->GetEntries() <<
", " << c->
GetCherenkovHits()->GetEntries() << endl;
720 cerr <<
"WCSimRootTrigger::CompareAllVariables() Different number of Cherenkov hit times: " << this->
GetCherenkovHitTimes()->GetEntries() <<
", " << c->
GetCherenkovHitTimes()->GetEntries() << endl;
724 cerr <<
"WCSimRootTrigger::CompareAllVariables() Different number of Cherenkov digi hits: " << this->
GetCherenkovDigiHits()->GetEntries() <<
", " << c->
GetCherenkovDigiHits()->GetEntries() << endl;
730 int ithis = -1, ithat = -1;
744 if(!tmp_track_1 || !tmp_track_2)
746 #ifdef VERBOSE_COMPARISON
747 cout <<
"Comparing track " << ithis
" in this with track"
748 << ithat
" in that" << endl;
754 cerr <<
"Only compared " << ncomp_track <<
" tracks. There should be " << TMath::Min(
fNtrack, c->
GetNtrack()) <<
" comparisons" << endl;
759 #ifdef VERBOSE_COMPARISON
760 cout <<
"Hit " << i << endl;
763 failed = thisfailed || failed;
769 for(
int j = timepos; j < timepos + totalpe; j++) {
770 #ifdef VERBOSE_COMPARISON
771 cout <<
"Hit Time " << j << endl;
781 ithis = -1, ithat = -1;
784 bool failed_digits =
false;
796 if(!tmp_digit_1 || !tmp_digit_2)
798 #ifdef VERBOSE_COMPARISON
799 cout <<
"Comparing digit " << ithis
" in this with digit"
800 << ithat
" in that" << endl;
809 failed = failed || failed_digits;
810 else if(failed_digits) {
811 cout <<
"Peforming deep comparison" << endl;
814 vector<WCSimRootCherenkovDigiHit *> tmpdigis;
819 int this_pmtid = tmp_digit_1->
GetTubeId();
824 if(tmp_digit_2->
GetTubeId() != this_pmtid) {
827 tmpdigis.push_back(tmp_digit_2);
830 if(!tmpdigis.size()) {
831 cerr <<
"No digits on this PMT with ID " << this_pmtid <<
" found on that" << endl;
835 for(
unsigned int i = 0; i < tmpdigis.size(); i++) {
848 for(
int ivtx = 0; ivtx <
fNvtxs; ivtx++) {
850 for(
int i = 0; i < 4; i++) {
851 failed = (!
ComparisonPassed(
fVtxs[ivtx][i], c->
GetVtxs(ivtx, i),
typeid(*this).name(), __func__, TString::Format(
"%s[%d][%d]",
"Vtxs", ivtx, i))) || failed;
virtual ~WCSimRootEvent()
Double_t GetTruetime() const
WCSimRootTrigger & operator=(const WCSimRootTrigger &in)
Float_t GetGammaE(int i) const
enum ETriggerType TriggerType_t
TriggerType_t fTriggerType
Int_t GetGammaID(int i) const
WCSimRootCherenkovHit * AddCherenkovHit(Int_t tubeID, std::vector< Double_t > truetime, std::vector< Int_t > primParID)
Int_t GetParentID() const
bool CompareAllVariables(const WCSimRootTrack *c) const
Float_t GetPdir(Int_t i=0) const
WCSimRootCherenkovHitTime()
Float_t GetPi0Vtx(int i) const
TClonesArray * GetCherenkovHitTimes() const
WCSimRootEventHeader * GetHeader()
static void Reset(Option_t *option="")
Int_t GetNcherenkovdigihits() const
TClonesArray * GetCherenkovHits() const
WCSimRootEvent & operator=(const WCSimRootEvent &in)
Float_t GetGammaVtx(int i, int j) const
WCSimRootCherenkovDigiHit * RemoveCherenkovDigiHit(WCSimRootCherenkovDigiHit *digit)
Float_t GetVtxs(Int_t n, Int_t i=0) const
Int_t GetNumTubesHit() const
Int_t fCherenkovHitCounter
Float_t GetStart(Int_t i=0) const
std::vector< Float_t > GetTriggerInfo() const
bool CompareAllVariables(const WCSimRootCherenkovHitTime *c) const
void Clear(Option_t *option="")
std::vector< Float_t > fTriggerInfo
WCSimRootPi0 * GetPi0Info()
Int_t fNcherenkovdigihits_slots
TClonesArray * GetTracks() const
Int_t GetStartvol() const
WCSimRootCherenkovDigiHit * AddCherenkovDigiHit(Double_t q, Double_t t, Int_t tubeid, std::vector< int > photon_ids)
void Clear(Option_t *option="")
Float_t fVtxs[MAX_N_VERTICES][4]
std::vector< int > GetPhotonIds() const
Int_t fNcherenkovhittimes
TClonesArray * fCherenkovDigiHits
bool CompareAllVariables(const WCSimRootPi0 *c) const
Int_t GetVtxsvol(Int_t i) const
bool CompareAllVariables(const WCSimRootEvent *c, bool deep_comparison=false) const
void SetTriggerInfo(TriggerType_t trigger_type, std::vector< Float_t > trigger_info)
Int_t GetParenttype() const
Int_t fMode[MAX_N_VERTICES]
std::vector< int > fPhotonIds
void SetPi0Info(Double_t pi0Vtx[3], Int_t gammaID[2], Double_t gammaE[2], Double_t gammaVtx[2][3])
WCSimRootTrigger * GetTrigger(int number)
WCSimRootEventHeader fEvtHdr
Float_t GetStop(Int_t i=0) const
Int_t GetNtrack_slots() const
Int_t GetNumberOfEvents() const
bool CompareAllVariables(const WCSimRootCherenkovHit *c) const
TClonesArray * fCherenkovHitTimes
WCSimRootCherenkovDigiHit()
static void Reset(Option_t *option="")
WCSimRootTrack * AddTrack(Int_t ipnu, Int_t flag, Double_t m, Double_t p, Double_t E, Int_t startvol, Int_t stopvol, Double_t dir[3], Double_t pdir[3], Double_t stop[3], Double_t start[3], Int_t parenttype, Double_t time, Int_t id)
Int_t GetNcherenkovhits() const
TriggerType_t GetTriggerType() const
TClonesArray * GetCherenkovDigiHits() const
void SetHeader(Int_t i, Int_t run, int64_t date, Int_t subevtn=1)
virtual ~WCSimRootTrigger()
void Set(Double_t pi0Vtx[3], Int_t gammaID[2], Double_t gammaE[2], Double_t gammaVtx[2][3])
Int_t GetVecRecNumber() const
bool CompareAllVariables(const WCSimRootCherenkovDigiHit *c) const
Int_t fNcherenkovdigihits
static const int MAX_N_VERTICES
Float_t GetDir(Int_t i=0) const
TClonesArray * fCherenkovHits
Int_t GetTotalPe(int i) const
bool CompareAllVariables(const WCSimRootTrigger *c, bool deep_comparison=false) const
WCSimRootTrack * RemoveTrack(WCSimRootTrack *track)
Int_t GetNcherenkovdigihits_slots() const
Int_t GetNumDigiTubesHit() const
Int_t GetNcherenkovhittimes() const
Int_t fVtxsvol[MAX_N_VERTICES]