#include <MoqBase.h>
Inheritance diagram for MoqBase:

|
||||||||||||||||||||
|
Definition at line 10 of file MoqBase.cxx. References Clear(), emrecord, fCurRun, InitChain(), isEM, isMC, isTH, lastEntry, mcrecord, Nentries, record, threcord, and whichSource. 00012 {
00013
00014 fCurRun = -1;
00015 lastEntry = -1;
00016 if(!chainSR) {
00017 record = 0;
00018 emrecord = 0;
00019 mcrecord = 0;
00020 threcord = 0;
00021 Clear();
00022 whichSource = -1;
00023 isMC = true;
00024 isTH = true;
00025 isEM = true;
00026 Nentries = -1;
00027 fCurRun = -1;
00028 return;
00029 }
00030
00031 InitChain(chainSR,chainMC,chainTH,chainEM);
00032 whichSource = 0;
00033
00034 }
|
|
||||||||||||||||
|
Definition at line 36 of file MoqBase.cxx. References Clear(), emrecord, fChain, fCurRun, fJC, isEM, isMC, isTH, jcPath, lastEntry, mcrecord, Nentries, record, threcord, and whichSource. 00037 {
00038 record = 0;
00039 emrecord = 0;
00040 mcrecord = 0;
00041 threcord = 0;
00042 Clear();
00043 isMC = true;
00044 isTH = true;
00045 isEM = true;
00046 Nentries = entries;
00047 whichSource = 1;
00048 jcPath = path;
00049 fCurRun = -1;
00050 lastEntry = -1;
00051 fJC = j;
00052 fChain = NULL;
00053 }
|
|
|
Definition at line 55 of file MoqBase.cxx. 00056 {
00057 if(fChain) delete fChain;
00058 }
|
|
|
Definition at line 157 of file MoqBase.cxx. References eventSummary, ntpEMShower, ntpEMSummary, ntpEvent, ntpHeader, ntpShieldStrip, ntpShower, ntpSlice, ntpStdHep, ntpStrip, ntpTHShower, ntpTHSlice, ntpTHTrack, ntpTrack, ntpTruth, and shieldSummary. Referenced by GetEntry(), MoqAnalysis::MoqAnalysis(), MoqBase(), and MoqQuantities::MoqQuantities(). 00157 {
00158
00159 ntpHeader = 0;
00160 shieldSummary = 0;
00161 eventSummary = 0;
00162 ntpSlice=0;
00163 ntpEvent=0;
00164 ntpTrack=0;
00165 ntpShower=0;
00166 ntpStrip=0;
00167 ntpShieldStrip=0;
00168
00169 ntpTruth=0;
00170 ntpStdHep=0;
00171
00172 ntpTHSlice=0;
00173 ntpTHTrack=0;
00174 ntpTHShower=0;
00175
00176 ntpEMSummary = 0;
00177 ntpEMShower = 0;
00178
00179 }
|
|
|
Definition at line 61 of file MoqBase.cxx. References Clear(), NtpEMRecord::emhdr, MoqChain::emRecord, emrecord, eventSummary, NtpSRRecord::evthdr, fChain, fCurRun, fJC, MoqChain::Get(), MomNavigator::GetFragment(), RecRecordImp< T >::GetHeader(), RecDataHeader::GetRun(), JobCInput::GoTo(), JobC::Input, isEM, isMC, isTH, jcPath, lastEntry, LoadEMShower(), LoadEvent(), LoadShieldStrip(), LoadShower(), LoadSlice(), LoadStdHep(), LoadTHShower(), LoadTHSlice(), LoadTHTrack(), LoadTrack(), LoadTruth(), MoqChain::mcRecord, mcrecord, JobC::Mom, ntpEMSummary, ntpHeader, JobC::Path, MoqChain::Record, record, shieldSummary, MoqChain::thRecord, threcord, NtpSRRecord::vetohdr, and whichSource. Referenced by MoqQuantities::MakeHistoFile(), and MoqAnalysis::UserFile(). 00062 {
00063 //zero everything before next snarl
00064 Clear();
00065
00066 //get records
00067 int status = 0;
00068 if(whichSource==-1) return 0;
00069 else if(whichSource==0) {
00070 if(entry!=lastEntry) {
00071 status = fChain->Get(entry);
00072 lastEntry = entry;
00073 }
00074 else status = 1;
00075 record = fChain->Record;
00076 mcrecord = fChain->mcRecord;
00077 threcord = fChain->thRecord;
00078 emrecord = fChain->emRecord;
00079 }
00080 else if(whichSource==1) {
00081 //allow for possibility that reco path can change event by event:
00082 isMC = isTH = isEM = true;
00083 //Get entry:
00084 //cout << "Getting Cand entry " << entry << " from "
00085 // << jcPath.c_str() << endl;
00086 if(entry!=lastEntry) {
00087 if(fCurRun!=-1) fJC->Input.GoTo(fCurRun,entry);
00088 fJC->Path(jcPath.c_str()).RunNin(1);
00089 lastEntry = entry;
00090 }
00091 //Look for records in mom:
00092 record = (NtpSRRecord*) fJC->Mom.GetFragment("NtpSRRecord");
00093 mcrecord = (NtpMCRecord*) fJC->Mom.GetFragment("NtpMCRecord");
00094 threcord = (NtpTHRecord*) fJC->Mom.GetFragment("NtpTHRecord");
00095 emrecord = (NtpEMRecord*) fJC->Mom.GetFragment("NtpEMRecord");
00096 //if no SR record quit
00097 if(record==0) return 0;
00098 //otherwise check for other records:
00099 status = 1;
00100 if(mcrecord==0) isMC = false;
00101 if(threcord==0) isTH = false;
00102 if(emrecord==0) isEM = false;
00103 }
00104 else return 0;
00105
00106 //set other things:
00107 ntpHeader = &(record->GetHeader());
00108 fCurRun = ntpHeader->GetRun();
00109 shieldSummary = &(record->vetohdr);
00110 eventSummary = &(record->evthdr);
00111 LoadSlice(0);
00112 LoadEvent(0);
00113 LoadTrack(0);
00114 LoadShower(0);
00115 LoadShieldStrip(0);
00116
00117 if(isEM) {
00118 ntpEMSummary = &(emrecord->emhdr);
00119 LoadEMShower(0);
00120 }
00121
00122 if(isMC) {
00123 LoadTruth(0);
00124 LoadStdHep(0);
00125 }
00126
00127 if(isTH) {
00128 LoadTHSlice(0);
00129 LoadTHTrack(0);
00130 LoadTHShower(0);
00131 }
00132 return status;
00133
00134 }
|
|
||||||||||||||||||||
|
Definition at line 136 of file MoqBase.cxx. References emrecord, fChain, MoqChain::isEM, isEM, MoqChain::isMC, isMC, MoqChain::isTH, isTH, mcrecord, MoqChain::Nentries, Nentries, record, and threcord. Referenced by MoqAnalysis::MoqAnalysis(), MoqBase(), and MoqQuantities::MoqQuantities(). 00138 {
00139
00140 record = 0;
00141 emrecord = 0;
00142 mcrecord = 0;
00143 threcord = 0;
00144
00145 fChain = new MoqChain(chainSR,chainMC,chainTH,chainEM);
00146 isMC = fChain->isMC;
00147 isTH = fChain->isTH;
00148 isEM = fChain->isEM;
00149 Nentries = fChain->Nentries;
00150
00151 if(isMC) std::cout << "MC Present" << std::endl;
00152 if(isTH) std::cout << "TH Present" << std::endl;
00153 if(isEM) std::cout << "EM Present" << std::endl;
00154
00155 }
|
|
|
Definition at line 423 of file MoqBase.cxx. References emrecord, NtpEMRecord::emshw, and ntpEMShower. Referenced by GetEntry(). 00423 {
00424
00425 Bool_t status = false;
00426 if(!isEM) return status;
00427 TClonesArray& showerArray = *(emrecord->emshw);
00428 if(ishw>=0&&ishw<showerArray.GetEntries()) {
00429 ntpEMShower = dynamic_cast<NtpEMShower *>(showerArray[ishw]);
00430 status = true;
00431 }
00432 else ntpEMShower = 0;
00433
00434 return status;
00435 }
|
|
|
Definition at line 263 of file MoqBase.cxx. References NtpSRRecord::evt, ntpEvent, and record. Referenced by GetEntry(), LoadSliceForRecoTH(), LoadTruthForReco(), and LoadTruthForRecoTH(). 00263 {
00264
00265 Bool_t status = false;
00266 TClonesArray& eventArray = *(record->evt);
00267 if(ievt>=0&&ievt<eventArray.GetEntries()) {
00268 ntpEvent = dynamic_cast<NtpSREvent *>(eventArray[ievt]);
00269 status = true;
00270 }
00271 else ntpEvent = 0;
00272
00273 return status;
00274 }
|
|
|
Definition at line 410 of file MoqBase.cxx. References ntpShieldStrip, record, and NtpSRRecord::vetostp. Referenced by GetEntry(). 00410 {
00411
00412 Bool_t status = false;
00413 TClonesArray& stripArray = *(record->vetostp);
00414 if(istp>=0&&istp<stripArray.GetEntries()) {
00415 ntpShieldStrip = dynamic_cast<NtpSRShieldStrip *>(stripArray[istp]);
00416 status = true;
00417 }
00418 else ntpShieldStrip = 0;
00419
00420 return status;
00421 }
|
|
|
Definition at line 209 of file MoqBase.cxx. References ntpShower, record, and NtpSRRecord::shw. Referenced by GetEntry(), MoqQuantities::GetShwSC(), and MoqQuantities::RecoShwEnergy(). 00209 {
00210
00211 Bool_t status = false;
00212 TClonesArray& showerArray = *(record->shw);
00213 if(ishw>=0&&ishw<showerArray.GetEntries()) {
00214 ntpShower = dynamic_cast<NtpSRShower *>(showerArray[ishw]);
00215 status = true;
00216 }
00217 else ntpShower = 0;
00218
00219 return status;
00220 }
|
|
|
Definition at line 236 of file MoqBase.cxx. References ntpSlice, record, and NtpSRRecord::slc. Referenced by GetEntry(), and LoadSliceForRecoTH(). 00236 {
00237
00238 Bool_t status = false;
00239 TClonesArray& sliceArray = *(record->slc);
00240 if(islc>=0&&islc<sliceArray.GetEntries()) {
00241 ntpSlice = dynamic_cast<NtpSRSlice *>(sliceArray[islc]);
00242 status = true;
00243 }
00244 else ntpSlice = 0;
00245
00246 return status;
00247 }
|
|
||||||||||||
|
Definition at line 339 of file MoqBase.cxx. References count, LoadEvent(), LoadSlice(), LoadTHSlice(), LoadTruthForRecoTH(), NtpTHSlice::neumc, ntpSlice, and ntpTHSlice. 00339 {
00340
00341 Bool_t status = false;
00342 ntpSlice = 0;
00343 if(!LoadEvent(ievt)) return status;
00344 if(!isMC) return status;
00345 if(!isTH) return status;
00346
00347 Int_t itru = 0;
00348 if(LoadTruthForRecoTH(ievt,itru)){
00349 Int_t count = 0;
00350 while(!status){
00351 if(!LoadTHSlice(count)) break;
00352 if(ntpTHSlice->neumc==itru) {
00353 if(LoadSlice(count)){
00354 islice = count;
00355 status = true;
00356 }
00357 }
00358 count += 1;
00359 }
00360 }
00361 return status;
00362 }
|
|
|
Definition at line 290 of file MoqBase.cxx. References mcrecord, ntpStdHep, and NtpMCRecord::stdhep. Referenced by GetEntry(). 00290 {
00291
00292 Bool_t status = false;
00293 if(!isMC) return status;
00294 TClonesArray& stdhepArray = *(mcrecord->stdhep);
00295 if(ish>=0&&ish<stdhepArray.GetEntries()) {
00296 ntpStdHep = dynamic_cast<NtpMCStdHep *>(stdhepArray[ish]);
00297 status = true;
00298 }
00299 else ntpStdHep = 0;
00300
00301 return status;
00302 }
|
|
|
Definition at line 397 of file MoqBase.cxx. References ntpStrip, record, and NtpSRRecord::stp. 00397 {
00398
00399 Bool_t status = false;
00400 TClonesArray& stripArray = *(record->stp);
00401 if(istp>=0&&istp<stripArray.GetEntries()) {
00402 ntpStrip = dynamic_cast<NtpSRStrip *>(stripArray[istp]);
00403 status = true;
00404 }
00405 else ntpStrip = 0;
00406
00407 return status;
00408 }
|
|
|
Definition at line 222 of file MoqBase.cxx. References ntpTHShower, threcord, and NtpTHRecord::thshw. Referenced by GetEntry(), and LoadTruthForRecoTH(). 00222 {
00223
00224 Bool_t status = false;
00225 if(!isTH) return status;
00226 TClonesArray& showerArray = *(threcord->thshw);
00227 if(ishw>=0&&ishw<showerArray.GetEntries()) {
00228 ntpTHShower = dynamic_cast<NtpTHShower *>(showerArray[ishw]);
00229 status = true;
00230 }
00231 else ntpTHShower = 0;
00232
00233 return status;
00234 }
|
|
|
Definition at line 249 of file MoqBase.cxx. References ntpTHSlice, threcord, and NtpTHRecord::thslc. Referenced by GetEntry(), and LoadSliceForRecoTH(). 00249 {
00250
00251 Bool_t status = false;
00252 if(!isTH) return status;
00253 TClonesArray& sliceArray = *(threcord->thslc);
00254 if(islc>=0&&islc<sliceArray.GetEntries()) {
00255 ntpTHSlice = dynamic_cast<NtpTHSlice *>(sliceArray[islc]);
00256 status = true;
00257 }
00258 else ntpTHSlice = 0;
00259
00260 return status;
00261 }
|
|
|
Definition at line 195 of file MoqBase.cxx. References ntpTHTrack, threcord, and NtpTHRecord::thtrk. Referenced by GetEntry(), and LoadTruthForRecoTH(). 00195 {
00196
00197 Bool_t status = false;
00198 if(!isTH) return status;
00199 TClonesArray& trackArray = *(threcord->thtrk);
00200 if(itrk>=0&&itrk<trackArray.GetEntries()) {
00201 ntpTHTrack = dynamic_cast<NtpTHTrack *>(trackArray[itrk]);
00202 status = true;
00203 }
00204 else ntpTHTrack = 0;
00205
00206 return status;
00207 }
|
|
|
Definition at line 182 of file MoqBase.cxx. References ntpTrack, record, and NtpSRRecord::trk. Referenced by GetEntry(), MoqQuantities::GetNonTrkSC(), MoqQuantities::GetShwSC(), MoqQuantities::IsFidAll(), MoqQuantities::PassTrackCuts(), MoqQuantities::RecoMuEnergy(), MoqQuantities::RecoMuQP(), and MoqQuantities::RecoQENuEnergy(). 00182 {
00183
00184 Bool_t status = false;
00185 TClonesArray& trackArray = *(record->trk);
00186 if(itrk>=0&&itrk<trackArray.GetEntries()) {
00187 ntpTrack = dynamic_cast<NtpSRTrack *>(trackArray[itrk]);
00188 status = true;
00189 }
00190 else ntpTrack = 0;
00191
00192 return status;
00193 }
|
|
|
Definition at line 276 of file MoqBase.cxx. References NtpMCRecord::mc, mcrecord, and ntpTruth. Referenced by GetEntry(), MoqQuantities::GetTrueShwSC(), MoqQuantities::IAction(), MoqQuantities::INu(), MoqQuantities::IResonance(), LoadTruthForReco(), LoadTruthForRecoTH(), MoqQuantities::TrueMuEnergy(), MoqQuantities::TrueMuQP(), MoqQuantities::TrueNuEnergy(), MoqQuantities::TrueShwEnergy(), MoqQuantities::TrueVtx(), MoqQuantities::TrueVxB(), MoqQuantities::W2(), and MoqQuantities::Y(). 00276 {
00277
00278 Bool_t status = false;
00279 if(!isMC) return status;
00280 TClonesArray& mcArray = *(mcrecord->mc);
00281 if(itr>=0&&itr<mcArray.GetEntries()) {
00282 ntpTruth = dynamic_cast<NtpMCTruth *>(mcArray[itr]);
00283 status = true;
00284 }
00285 else ntpTruth = 0;
00286
00287 return status;
00288 }
|
|
||||||||||||
|
Definition at line 304 of file MoqBase.cxx. References LoadEvent(), LoadTruth(), NtpMCRecord::mc, mcrecord, ntpEvent, ntpTruth, NtpSREvent::vtx, NtpMCTruth::vtxx, NtpMCTruth::vtxy, NtpMCTruth::vtxz, NtpSRVertex::x, NtpSRVertex::y, and NtpSRVertex::z. 00304 {
00305
00306 Bool_t status = false;
00307 ntpTruth = 0;
00308 if(!LoadEvent(ievt)) return status;
00309 if(!isMC) return status;
00310
00311 TClonesArray& mcArray = *(mcrecord->mc);
00312 if(mcArray.GetEntries()==1) { //if only one MC event is present just load it
00313 LoadTruth(0);
00314 return true;
00315 }
00316
00317 float mindist = 999;
00318 int itr = 0;
00319 //loop over all MC events and look for closest vertex to reco vertex
00320 for(int i=0;i<mcArray.GetEntries();i++){
00321 ntpTruth = dynamic_cast<NtpMCTruth *>(mcArray[i]);
00322 float dist = sqrt(TMath::Power(ntpTruth->vtxx/100.-ntpEvent->vtx.x,2)
00323 +TMath::Power(ntpTruth->vtxy/100.-ntpEvent->vtx.y,2)
00324 +TMath::Power(ntpTruth->vtxz/100.-ntpEvent->vtx.z,2));
00325 if(dist<mindist) {
00326 itr = i;
00327 mindist = dist;
00328 }
00329 }
00330
00331 if(mindist<0.5) { //Need to place a fairly loose cut to pick up showers
00332 status = true; //From looking at FarDet events, a cut of 0.5m
00333 LoadTruth(itr); //correctly pairs up 95% of events (LE beam,unoscillated)
00334 itruth = itr;
00335 }
00336 return status;
00337 }
|
|
||||||||||||
|
Definition at line 365 of file MoqBase.cxx. References LoadEvent(), LoadTHShower(), LoadTHTrack(), LoadTruth(), NtpTHShower::neumc, NtpTHTrack::neumc, NtpSREvent::nshower, ntpEvent, ntpTHShower, ntpTHTrack, ntpTruth, NtpSREvent::ntrack, NtpSREvent::shw, and NtpSREvent::trk. Referenced by LoadSliceForRecoTH(). 00365 {
00366
00367 Bool_t status = false;
00368 ntpTruth = 0;
00369 if(!LoadEvent(ievt)) return status;
00370 if(!isMC) return status;
00371 if(!isTH) return status;
00372
00373 if(ntpEvent->ntrack>0) {
00374 int *tracks = ntpEvent->trk;
00375 if(LoadTHTrack(int(tracks[0]))){
00376 int ind = ntpTHTrack->neumc;
00377 if(LoadTruth(ind)) {
00378 itruth = ind;
00379 status = true;
00380 }
00381 }
00382 }
00383 if(!status&&ntpEvent->nshower>0) {
00384 int *showers = ntpEvent->shw;
00385 if(LoadTHShower(int(showers[0]))){
00386 int ind = ntpTHShower->neumc;
00387 if(LoadTruth(ind)) {
00388 itruth = ind;
00389 status = true;
00390 }
00391 }
00392 }
00393 return status;
00394
00395 }
|
|
|
Definition at line 66 of file MoqBase.h. Referenced by GetEntry(), InitChain(), LoadEMShower(), and MoqBase(). |
|
|
Definition at line 49 of file MoqBase.h. Referenced by Clear(), and GetEntry(). |
|
|
Definition at line 38 of file MoqBase.h. Referenced by GetEntry(), InitChain(), and MoqBase(). |
|
|
Definition at line 41 of file MoqBase.h. Referenced by GetEntry(), and MoqBase(). |
|
|
Definition at line 39 of file MoqBase.h. Referenced by GetEntry(), and MoqBase(). |
|
|
Definition at line 72 of file MoqBase.h. Referenced by GetEntry(), InitChain(), and MoqBase(). |
|
|
Definition at line 70 of file MoqBase.h. Referenced by GetEntry(), InitChain(), and MoqBase(). |
|
|
Definition at line 71 of file MoqBase.h. Referenced by GetEntry(), InitChain(), and MoqBase(). |
|
|
Definition at line 40 of file MoqBase.h. Referenced by GetEntry(), and MoqBase(). |
|
|
Definition at line 42 of file MoqBase.h. Referenced by GetEntry(), and MoqBase(). |
|
|
Definition at line 57 of file MoqBase.h. Referenced by GetEntry(), InitChain(), LoadStdHep(), LoadTruth(), LoadTruthForReco(), and MoqBase(). |
|
|
Definition at line 73 of file MoqBase.h. Referenced by InitChain(), and MoqBase(). |
|
|
Definition at line 68 of file MoqBase.h. Referenced by Clear(), and LoadEMShower(). |
|
|
Definition at line 67 of file MoqBase.h. Referenced by Clear(), and GetEntry(). |
|
|
Definition at line 50 of file MoqBase.h. Referenced by Clear(), LoadEvent(), LoadTruthForReco(), and LoadTruthForRecoTH(). |
|
|
Definition at line 47 of file MoqBase.h. Referenced by Clear(), and GetEntry(). |
|
|
Definition at line 54 of file MoqBase.h. Referenced by Clear(), and LoadShieldStrip(). |
|
|
Definition at line 52 of file MoqBase.h. Referenced by Clear(), and LoadShower(). |
|
|
Definition at line 53 of file MoqBase.h. Referenced by Clear(), LoadSlice(), and LoadSliceForRecoTH(). |
|
|
Definition at line 59 of file MoqBase.h. Referenced by Clear(), and LoadStdHep(). |
|
|
Definition at line 55 of file MoqBase.h. Referenced by Clear(), and LoadStrip(). |
|
|
Definition at line 64 of file MoqBase.h. Referenced by Clear(), LoadTHShower(), and LoadTruthForRecoTH(). |
|
|
Definition at line 62 of file MoqBase.h. Referenced by Clear(), LoadSliceForRecoTH(), and LoadTHSlice(). |
|
|
Definition at line 63 of file MoqBase.h. Referenced by Clear(), LoadTHTrack(), and LoadTruthForRecoTH(). |
|
|
Definition at line 51 of file MoqBase.h. Referenced by Clear(), and LoadTrack(). |
|
|
Definition at line 58 of file MoqBase.h. Referenced by Clear(), LoadTruth(), LoadTruthForReco(), and LoadTruthForRecoTH(). |
|
|
Definition at line 46 of file MoqBase.h. Referenced by GetEntry(), InitChain(), LoadEvent(), LoadShieldStrip(), LoadShower(), LoadSlice(), LoadStrip(), LoadTrack(), and MoqBase(). |
|
|
Definition at line 48 of file MoqBase.h. Referenced by Clear(), and GetEntry(). |
|
|
Definition at line 61 of file MoqBase.h. Referenced by GetEntry(), InitChain(), LoadTHShower(), LoadTHSlice(), LoadTHTrack(), and MoqBase(). |
|
|
Definition at line 44 of file MoqBase.h. Referenced by GetEntry(), and MoqBase(). |
1.3.9.1