25 cout <<
"********************************************************" << endl;
27 for(
int itrigger = 0; itrigger < wcsimrootsuperevent->
GetNumberOfEvents(); itrigger++) {
28 wcsimrootevent = wcsimrootsuperevent->
GetTrigger(itrigger);
30 cout <<
"Header+ in WCSim file: " <<
filename << endl;
32 cout <<
"-----------" << endl;
36 cout <<
"Mode: " << wcsimrootevent->
GetMode() << endl;
39 cout <<
"Vtxvol: " << wcsimrootevent->
GetVtxvol() << endl;
40 for(
int i = 0;
i < 3;
i++)
41 cout <<
"Vtx[" <<
i <<
"]: " << wcsimrootevent->
GetVtx(
i) << endl;
42 cout <<
"Number of photoelectron hit times " << wcsimrootevent->
GetCherenkovHitTimes()->GetEntries() << endl;
43 cout <<
"Number of tube hits " << wcsimrootevent->
GetNumTubesHit() << endl;
45 cout <<
"Number of tracks " << wcsimrootevent->
GetNtrack() << endl;
46 cout <<
"Number of digitized tube hits " << wcsimrootevent->
GetNumDigiTubesHit() << endl;
52 cout <<
"********************************************************" << endl;
53 cout <<
"Geom summary+ in WCSim file: " <<
filename << endl;
62 TFile *f =
new TFile(
filename,
"read");
64 cout <<
"Error, could not open input file: " <<
filename << endl;
69 f->GetObject(treename, wcsimT);
71 cerr << treename <<
" tree could not be opened in input file: " <<
filename << endl;
79 nevent = wcsimT->GetEntries();
81 wcsimT->SetBranchAddress(
"wcsimrootevent",&wcsimrootsuperevent);
85 wcsimT->GetBranch(
"wcsimrootevent")->SetAutoDelete(kTRUE);
88 return wcsimrootsuperevent;
93 nevent = wcsimT->GetEntries();
95 wcsimT->SetBranchAddress(
"wcsimrootgeom", &wcsimrootgeom);
101 void complete_comparison(
const char *filename1,
const char *filename2,
string treename =
"wcsimT",
bool verbose=
false,
const Long64_t oneevent = -1)
104 TTree * wcsimT1 =
GetTree(filename1, treename.c_str());
107 TTree * wcsimT2 =
GetTree(filename2, treename.c_str());
113 if(treename ==
"wcsimT") {
117 else if(treename ==
"wcsimGeoT") {
122 cerr << treename <<
" is not a valid treename for complete_comparison(). Exiting" << endl;
126 cout <<
"Tree " << treename <<
" in file 1 (2) has " << nevents1 <<
" (" << nevents2 <<
") events" << endl;
129 Long64_t nevents_failed = 0, nevents_analysed = 0;
130 Long64_t nevent = TMath::Min(nevents1, nevents2);
134 nevent = oneevent + 1;
136 for ( ; ev < nevent; ev++)
138 cout <<
"Comparing event " << ev << endl;
141 wcsimT1->GetEntry(ev);
142 wcsimT2->GetEntry(ev);
145 if(verbose || ev == 0){
146 if(wcsimrootsuperevent1) {
150 else if(wcsimrootgeom1) {
158 if(wcsimrootsuperevent1) {
159 failed = !(wcsimrootsuperevent1->CompareAllVariables(wcsimrootsuperevent2,
true));
161 else if(wcsimrootgeom1) {
165 if(verbose || ev == 0)
166 cout <<
"Event " << ev <<
" comparison " << (failed ?
"FAILED" :
"PASSED") << endl;
170 if(wcsimrootsuperevent1) {
172 wcsimrootsuperevent1->ReInitialize();
176 cout << nevents_failed <<
" events out of " << nevents_analysed <<
" have failures " << endl;
Detector geometry information (also containing PMT information arrays)
Float_t GetWCPMTRadius(bool hybridsecondtype=false) const
Float_t GetWCCylLength() const
Int_t GetNumberOfSubEvents() const
Float_t GetWCCylRadius() const
WCSimRootEvent * GetRootEvent(TTree *wcsimT, int &nevent)
Int_t GetNumDigiTubesHit() const
void complete_comparison(const char *filename1, const char *filename2, string treename="wcsimT", bool verbose=false, const Long64_t oneevent=-1)
WCSimRootEventHeader * GetHeader()
Float_t GetVtx(Int_t i=0)
Int_t GetWCNumPMT(bool hybridsecondtype=false) const
void PrintHeaderInfo(WCSimRootEvent *wcsimrootsuperevent, const char *filename)
Class storing trigger information.
WCSimRootTrigger * GetTrigger(int number)
TClonesArray * GetCherenkovHitTimes() const
Int_t GetNumTubesHit() const
Int_t GetNumberOfEvents() const
Class containing event information.
TTree * GetTree(const char *filename, const char *treename)
void PrintGeomSummary(WCSimRootGeom *geo, const char *filename)
bool CompareAllVariables(const WCSimRootGeom *c) const
WCSimRootGeom * GetRootGeom(TTree *wcsimT, int &nevent)