AtNuShieldPerformance Class Reference

#include <AtNuShieldPerformance.h>

List of all members.

Public Member Functions

 AtNuShieldPerformance ()
 AtNuShieldPerformance (const char *name)
 ~AtNuShieldPerformance ()
bool FillEvent (const AtmosEvent *event)
bool FillEvent (TClonesArray *ShieldPlankList, TClonesArray *TrackList, TClonesArray *ShowerList, int UnixTime=0)
void EvalShieldPlanks (TClonesArray *ShieldPlankList)
std::vector< SimplePlankEndExpectedPlanks (const AtmosTrack *)
void MakeHistos ()
void Reset ()
void Finish ()
int Loud ()
void Loud (int i)
int MinSec ()
void MinSec (int i)
int MaxSec ()
void MaxSec (int i)
bool WriteMaps ()
void WriteMaps (bool i)

Private Member Functions

std::vector< MatchPlankMatchTrack (AtmosTrack *, TClonesArray *)
std::vector< MatchPlankMatchShower (AtmosShower *, TClonesArray *)

Private Attributes

int fLoud
int fWriteMaps
int fMinSec
int fMaxSec
int fNEvents
int fNVetoed
ShieldGeomfShGeom
VldContextfVldContext
std::string fHName
ShieldPerfMapsfPerfMaps
TH1F * hTrackPlanes
TH1F * hShowerPlanes
TH1F * hNPlanks [5]
TH1F * hTimeSpan [5]
TH1F * hPlankRate [5]
TH1F * hMeanPlankTime [5]
TH1F * hRMSPlankTime [5]
TH1F * hMeanPlankPE [5]
TH1F * hRMSPlankPE [5]
TH1F * hMaxNPlanks100nsWin [5]
TH1F * hMeanNPlanks100nsWin [5]
TH1F * hTrkVtxPlaneAll
TH1F * hTrkVtxPlaneVet
TH1F * hTrkVtxXAll [5]
TH1F * hTrkVtxXVet [5]
TH1F * hTrkVtxYAll [5]
TH1F * hTrkVtxYVet [5]
TH2F * hTrkVtxXYAll [5]
TH2F * hTrkVtxXYVet [5]
TH1F * hShwVtxPlaneAll
TH1F * hShwVtxPlaneVet
TH1F * hShwVtxXAll [5]
TH1F * hShwVtxXVet [5]
TH1F * hShwVtxYAll [5]
TH1F * hShwVtxYVet [5]
TH2F * hShwVtxXYAll [5]
TH2F * hShwVtxXYVet [5]
TH1F * hDayAll [5]
TH1F * hDayVet [5]
TH1F * hWeekAll [5]
TH1F * hWeekVet [5]
TH1F * hFNghtAll [5]
TH1F * hFNghtVet [5]
TH1F * hShwDVtxPlankTimeAll
TH1F * hTrkDVtxPlankTimeAll
TH1F * hShwDVtxPlankTimeBest
TH1F * hTrkDVtxPlankTimeBest


Detailed Description

Definition at line 69 of file AtNuShieldPerformance.h.


Constructor & Destructor Documentation

AtNuShieldPerformance::AtNuShieldPerformance (  ) 

Definition at line 41 of file AtNuShieldPerformance.cxx.

References fHName, fLoud, fMaxSec, fMinSec, fPerfMaps, fShGeom, fVldContext, and Reset().

00042 {
00043   std::cout << " *** AtNuShieldPerformance::AtNuShieldPerformance() *** " << std::endl;
00044 
00045   fPerfMaps = new ShieldPerfMaps();
00046 
00047   fLoud = 0;
00048   fShGeom = 0;
00049   fVldContext = 0;
00050   Reset();
00051 
00052   fHName = "";
00053 
00054   fMinSec = 1041379200; // 2003-01-01 00:00:00 UTC
00055   fMaxSec = 1262304000; // 2010-01-01 00:00:00 UTC
00056 }

AtNuShieldPerformance::AtNuShieldPerformance ( const char *  name  ) 

Definition at line 58 of file AtNuShieldPerformance.cxx.

References fHName, fLoud, fMaxSec, fMinSec, fPerfMaps, fShGeom, fVldContext, and Reset().

00059 {
00060   std::cout << " *** AtNuShieldPerformance::AtNuShieldPerformance(" << name << ") *** " << std::endl;
00061 
00062   fPerfMaps = new ShieldPerfMaps();
00063 
00064   fHName = name;
00065   fShGeom = 0;
00066   fVldContext = 0;
00067   fLoud = 0;
00068 
00069   Reset();
00070 
00071   fMinSec = 1041379200; // 2003-01-01 00:00:00 UTC
00072   fMaxSec = 1262304000; // 2010-01-01 00:00:00 UTC
00073 }

AtNuShieldPerformance::~AtNuShieldPerformance (  ) 

Definition at line 87 of file AtNuShieldPerformance.cxx.

References fLoud.

00088 {
00089   if(fLoud>=2) cout << "AtNuShieldPerformance::~AtNuShieldPerformance" << endl;
00090 }


Member Function Documentation

void AtNuShieldPerformance::EvalShieldPlanks ( TClonesArray *  ShieldPlankList  ) 

Definition at line 487 of file AtNuShieldPerformance.cxx.

References C, MuELoss::e, fClearFibreN, fWlsFibreN, hMaxNPlanks100nsWin, hMeanNPlanks100nsWin, hMeanPlankPE, hMeanPlankTime, hNPlanks, hPlankRate, hRMSPlankPE, hRMSPlankTime, and hTimeSpan.

Referenced by FillEvent().

00488 {
00489   double MeanPlankPE[5] = {0.0, 0.0, 0.0, 0.0, 0.0};
00490   double RMSPlankPE[5] = {0.0, 0.0, 0.0, 0.0, 0.0};
00491   double MeanPlankTime[5] = {0.0, 0.0, 0.0, 0.0, 0.0};
00492   double RMSPlankTime[5] = {0.0, 0.0, 0.0, 0.0, 0.0};
00493   double NPlankEnds[5] = {0.0, 0.0, 0.0, 0.0, 0.0};
00494   double NPlanks[5] = {0.0, 0.0, 0.0, 0.0, 0.0};
00495   double MinPlankTime[5] = {1.0, 1.0, 1.0, 1.0, 1.0};
00496   double MaxPlankTime[5] = {-1.0, -1.0, -1.0, -1.0, -1.0};
00497   std::vector<double> vPlankDTime;
00498 
00499   for (int iplk=0; iplk<ShieldPlankList->GetLast()+1; iplk++) {
00500     const AtmosShieldPlank *plank = dynamic_cast<const AtmosShieldPlank*>
00501       (ShieldPlankList->At(iplk));
00502 
00503     if(plank->QPE[0] == 0 && plank->QPE[1] == 0) continue;
00504 
00505     double PlankPE = plank->QPE[0] + plank->QPE[1];
00506     MeanPlankPE[0] += PlankPE;
00507     MeanPlankPE[plank->Section] += PlankPE;
00508     RMSPlankPE[0] += PlankPE*PlankPE;
00509     RMSPlankPE[plank->Section] += PlankPE*PlankPE;
00510 
00511     NPlanks[0] += 1.0;
00512     NPlanks[plank->Section] += 1.0;
00513 
00514     for (unsigned int iend=0; iend<2; iend++) {
00515       if(plank->QPE[iend] == 0) continue;
00516 
00517       NPlankEnds[0] += 1.0;
00518       NPlankEnds[plank->Section] += 1.0;
00519 
00520       double DTime = plank->Tcal[iend];
00521       DTime -= plank->WlsPigtail[iend]*fWlsFibreN/TMath::C();
00522       DTime -= plank->ClearFibre[iend]*fClearFibreN/TMath::C();
00523       //DTime -= TMath::Abs(VtxZ-plank->Z[iend])*fWlsFibreN/TMath::C();
00524 
00525       vPlankDTime.push_back(DTime);
00526 
00527       MeanPlankTime[0] += DTime;
00528       MeanPlankTime[plank->Section] += DTime;
00529       RMSPlankTime[0] += DTime*DTime;
00530       RMSPlankTime[plank->Section] += DTime*DTime;
00531 
00532       if(DTime < MinPlankTime[0]) MinPlankTime[0] = DTime;
00533       if(DTime < MinPlankTime[plank->Section])
00534           MinPlankTime[plank->Section] = DTime;
00535 
00536       if(DTime > MaxPlankTime[0]) MaxPlankTime[0] = DTime;
00537       if(DTime > MaxPlankTime[plank->Section])
00538           MaxPlankTime[plank->Section] = DTime;
00539     }
00540   }
00541 
00542   for (int isect=0;isect<=4; isect++) {
00543     hNPlanks[isect]->Fill(NPlanks[isect]);
00544     double TimeSpan = MaxPlankTime[isect]-MinPlankTime[isect];
00545     hTimeSpan[isect]->Fill(MaxPlankTime[isect]-MinPlankTime[isect]);
00546     if(TimeSpan > 0) hPlankRate[isect]->Fill(NPlanks[isect]/TimeSpan);
00547 
00548     if (NPlanks[isect]>0) {
00549       MeanPlankPE[isect] /= NPlanks[isect];
00550       hMeanPlankPE[isect]->Fill(MeanPlankPE[isect]);
00551       if (NPlanks[isect]>1) {
00552         RMSPlankPE[isect] = ((RMSPlankPE[isect]/NPlanks[isect]) -
00553           MeanPlankPE[isect]*MeanPlankPE[isect]);
00554         if(RMSPlankPE[isect] <= 0.0) RMSPlankPE[isect] = 0.0;
00555         else RMSPlankPE[isect] = sqrt(RMSPlankPE[isect]);
00556         hRMSPlankPE[isect]->Fill(RMSPlankPE[isect]);
00557       }
00558     }
00559 
00560     if (NPlankEnds[isect]>0) {
00561       MeanPlankTime[isect] /= NPlankEnds[isect];
00562       hMeanPlankTime[isect]->Fill(1e6*MeanPlankTime[isect]);
00563       if (NPlankEnds[isect]>1) {
00564         RMSPlankTime[isect] = (RMSPlankTime[isect]/NPlankEnds[isect]) -
00565           MeanPlankTime[isect]*MeanPlankTime[isect];
00566         if(RMSPlankTime[isect] <= 0.0) RMSPlankTime[isect] = 0.0;
00567         else RMSPlankTime[isect] = sqrt(RMSPlankTime[isect]);
00568         hRMSPlankTime[isect]->Fill(1e6*RMSPlankTime[isect]);
00569       }
00570     }
00571   }
00572 
00573   int MaxNPlanks100nsWin = 0;
00574   double MeanNPlanks100nsWin(0.0), N100nsWindows(0.0);
00575   std::sort(vPlankDTime.begin(), vPlankDTime.end());
00576   for (unsigned int idt=0; idt<vPlankDTime.size(); idt++) {
00577     double PlankTimeWin = vPlankDTime[idt]+100e-9;
00578     int NPlanks100nsWin = 1;//Count the first plank
00579     unsigned int jdt;
00580     for (jdt=idt+1; jdt<vPlankDTime.size(); jdt++) {
00581       if(vPlankDTime[jdt] < PlankTimeWin) NPlanks100nsWin++;
00582       else break;
00583     }
00584     N100nsWindows += 1.0;
00585     MeanNPlanks100nsWin += NPlanks100nsWin;
00586     if(NPlanks100nsWin>MaxNPlanks100nsWin) MaxNPlanks100nsWin=NPlanks100nsWin;
00587 
00588     //break if the inner loop hit the end of the vector
00589     if(jdt == vPlankDTime.size()) break;
00590 
00591     if(NPlanks100nsWin == 1 && (idt+1) < vPlankDTime.size()) {
00592       N100nsWindows += ((vPlankDTime[idt+1]-vPlankDTime[idt])/100e-9) - 1.0;
00593       //double Sup = ((vPlankDTime[idt+1]-vPlankDTime[idt])/100e-9) - 1.0;
00594       //cout << "Sup = " << Sup << endl;
00595     }
00596   }
00597 
00598   hMaxNPlanks100nsWin[0]->Fill(MaxNPlanks100nsWin);
00599   if (N100nsWindows>0.0) {
00600     hMeanNPlanks100nsWin[0]->Fill(MeanNPlanks100nsWin/N100nsWindows);
00601     //cout << "100ns NPlanks = " << MeanNPlanks100nsWin/N100nsWindows << endl;
00602   }
00603 
00604   /*
00605   //Alternate method to measure the MeanPlanks in a 100nsWindow
00606   int iWindow = 1;
00607   double T0 = *(vPlankDTime.begin());
00608   double TF = *(vPlankDTime.rbegin());
00609   MeanNPlanks100nsWin = 0.0;
00610   N100nsWindows = 0.0;
00611   while ((T0+iWindow*100e-9) < TF) {
00612     N100nsWindows += 1.0;
00613     int NPlanks100nsWin = 
00614     std::count_if(vPlankDTime.begin(), vPlankDTime.end(),
00615       __gnu_cxx::compose2(std::logical_and<bool>(),
00616         std::bind2nd(std::greater_equal<double>(), T0+iWindow*100e-9),
00617         std::bind2nd(std::less_equal<double>(), T0+(iWindow+1)*100e-9)));
00618 
00619     MeanNPlanks100nsWin += NPlanks100nsWin;
00620 
00621     iWindow++;
00622   }
00623   */
00624 }

std::vector< SimplePlankEnd > AtNuShieldPerformance::ExpectedPlanks ( const AtmosTrack  ) 

Definition at line 872 of file AtNuShieldPerformance.cxx.

References NtpSRVertex::dcosx, NtpSRVertex::dcosy, NtpSRVertex::dcosz, CandShieldSR::GetCandShieldPlane(), CandShieldSR::GetCandShieldStrip0(), CandShieldSR::HitsInShield(), NtpSRVertex::x, NtpSRVertex::y, and NtpSRVertex::z.

Referenced by FillEvent().

00873 {
00874   assert(track);
00875 
00876   std::vector<SimplePlankEnd> vplanks;
00877 
00878   NtpSRVertex TrkVtx;
00879   NtpSRVertex TrkEnd;
00880 
00881   TrkVtx.x = track->VtxX;
00882   TrkVtx.y = track->VtxY;
00883   TrkVtx.z = track->VtxZ;
00884   TrkVtx.dcosx = track->VtxDirCosX;
00885   TrkVtx.dcosy = track->VtxDirCosY;
00886   TrkVtx.dcosz = track->VtxDirCosZ;
00887 
00888   TrkEnd.x = track->EndX;
00889   TrkEnd.y = track->EndY;
00890   TrkEnd.z = track->EndZ;
00891   TrkEnd.dcosx = track->EndDirCosX;
00892   TrkEnd.dcosy = track->EndDirCosY;
00893   TrkEnd.dcosz = track->EndDirCosZ;
00894 
00895   if(!fShGeom) {
00896     fShGeom = new ShieldGeom(*fVldContext);
00897   }
00898   else {
00899     fShGeom->Reinitialize(*fVldContext);
00900   }
00901 
00902   CandShieldSR candsh(TrkVtx, TrkEnd, fShGeom);
00903 
00904   for (int iplank=0; iplank<candsh.HitsInShield(); iplank++) {
00905     SimplePlankEnd plank;
00906     plank.Plane = candsh.GetCandShieldPlane(iplank+1);
00907     plank.Plank = candsh.GetCandShieldStrip0(iplank+1);
00908     plank.End = 0;
00909     vplanks.push_back(plank);
00910 
00911     plank.End = 1;
00912     vplanks.push_back(plank);
00913   }
00914 
00915   return vplanks;
00916 }

bool AtNuShieldPerformance::FillEvent ( TClonesArray *  ShieldPlankList,
TClonesArray *  TrackList,
TClonesArray *  ShowerList,
int  UnixTime = 0 
)

Definition at line 237 of file AtNuShieldPerformance.cxx.

References MuELoss::e, SimplePlankEnd::End, EvalShieldPlanks(), ExpectedPlanks(), find(), fLoud, ShieldPerfMaps::fNAllExpPlanks, fNEvents, ShieldPerfMaps::fNVetExpPlanks, fNVetoed, ShieldPerfMaps::fNVetPlanks, fPerfMaps, fWriteMaps, hDayAll, hDayVet, hFNghtAll, hFNghtVet, hShowerPlanes, hShwVtxPlaneAll, hShwVtxPlaneVet, hShwVtxXAll, hShwVtxXVet, hShwVtxXYAll, hShwVtxXYVet, hShwVtxYAll, hShwVtxYVet, hTrackPlanes, hTrkVtxPlaneAll, hTrkVtxPlaneVet, hTrkVtxXAll, hTrkVtxXVet, hTrkVtxXYAll, hTrkVtxXYVet, hTrkVtxYAll, hTrkVtxYVet, hWeekAll, hWeekVet, MatchShower(), MatchTrack(), SimplePlankEnd::Plane, SimplePlankEnd::Plank, and UtilShield::ShieldPlanesAdjacent().

00240 {
00241   if(fLoud>=3) cout << "AtNuShieldPerformance::FillEvent" << endl;
00242   assert(ShieldPlankList);
00243   assert(TrackList);
00244   assert(ShowerList);
00245 
00246   EvalShieldPlanks(ShieldPlankList);
00247 
00248   bool VetoEvent[5] = {false, false, false, false, false};
00249 
00250   for (int itrk=0; itrk<TrackList->GetEntries(); itrk++) {
00251     AtmosTrack *track = dynamic_cast<AtmosTrack*>(TrackList->At(itrk));
00252     hTrackPlanes->Fill(track->Nplanes);
00253 
00254     double VtxX = track->VtxX;
00255     double VtxY = track->VtxY;
00256     double VtxZ = track->VtxZ;
00257     double VtxPlane = track->VtxPlane;
00258 
00259     if (track->VtxY<track->EndY) {
00260       VtxX = track->EndX; 
00261       VtxY = track->EndY; 
00262       VtxZ = track->EndZ;
00263       VtxPlane = track->EndPlane; 
00264     }
00265 
00266     hTrkVtxPlaneAll->Fill(VtxPlane);
00267     for (int isect=0; isect<=4; isect++) {
00268       hTrkVtxXAll[isect]->Fill(VtxX);
00269       hTrkVtxYAll[isect]->Fill(VtxY);
00270       hTrkVtxXYAll[isect]->Fill(VtxX, VtxY);
00271     }
00272 
00273     if (fLoud>=2) {
00274       cout << "Track # " << itrk
00275            << " Vtx=(" << VtxX << "," << VtxY << "," << VtxZ << ")"
00276            << " Length = " << track->Nplanes << " planes" << endl;
00277     }
00278 
00279     std::vector<MatchPlank> vMPlnk = MatchTrack(track, ShieldPlankList);
00280 
00281     bool ShieldSectionVeto[5] = {false, false, false, false, false};
00282     for (unsigned int iplnk=0; iplnk<vMPlnk.size(); iplnk++) {
00283       if(fLoud>1) cout << " Match Section " << vMPlnk[iplnk].plank->Section
00284         << " DTime=(" << vMPlnk[iplnk].DTime[0] << "," << vMPlnk[iplnk].DTime[1]
00285         << ") Tcal=(" << vMPlnk[iplnk].plank->Tcal[0] << ","
00286         << vMPlnk[iplnk].plank->Tcal[1] << ")" << endl
00287         << "   QPE=(" << vMPlnk[iplnk].plank->QPE[0] << ","
00288         << vMPlnk[iplnk].plank->QPE[1] << ")"
00289         << " Qadc=(" << vMPlnk[iplnk].plank->Qadc[0] << ","
00290         << vMPlnk[iplnk].plank->Qadc[1] << ")" << endl;
00291 
00292       if ((fabs(vMPlnk[iplnk].DTime[0])<50e-9 &&
00293            vMPlnk[iplnk].plank->QPE[0]>0) ||
00294           (fabs(vMPlnk[iplnk].DTime[1])<50e-9 &&
00295            vMPlnk[iplnk].plank->QPE[1]>0)) {
00296         ShieldSectionVeto[0] = true;
00297         ShieldSectionVeto[vMPlnk[iplnk].plank->Section] = true;
00298       }
00299     }
00300 
00301     for (int isect=0; isect<=4; isect++) {
00302       if(!ShieldSectionVeto[isect]) continue;
00303 
00304       VetoEvent[isect] = true;
00305 
00306       if(isect==0) hTrkVtxPlaneVet->Fill(VtxPlane);
00307       hTrkVtxXVet[isect]->Fill(VtxX);
00308       hTrkVtxYVet[isect]->Fill(VtxY);
00309       hTrkVtxXYVet[isect]->Fill(VtxX, VtxY);
00310     }
00311 
00312     if(!fWriteMaps) continue;
00313     //Everything below this point is only done if maps are to written out
00314 
00315     std::vector<SimplePlankEnd> vEPlnk = ExpectedPlanks(track);
00316     std::vector<SimplePlankEnd> vVetPlnk;
00317 
00318     for (unsigned int iplk=0; iplk<vMPlnk.size(); iplk++) {
00319       if (vMPlnk[iplk].plank->QPE[0]>0 && fabs(vMPlnk[iplk].DTime[0])<50e-9) {
00320         SimplePlankEnd spe;
00321         spe.Plane = vMPlnk[iplk].plank->Plane;
00322         spe.Plank = vMPlnk[iplk].plank->Plank;
00323         spe.End = 0;
00324         vVetPlnk.push_back(spe);
00325         fPerfMaps->fNVetPlanks[spe].push_back(UnixTime);
00326       }
00327       if (vMPlnk[iplk].plank->QPE[1]>0 && fabs(vMPlnk[iplk].DTime[1])<50e-9) {
00328         SimplePlankEnd spe;
00329         spe.Plane = vMPlnk[iplk].plank->Plane;
00330         spe.Plank = vMPlnk[iplk].plank->Plank;
00331         spe.End = 1;
00332         vVetPlnk.push_back(spe);
00333         fPerfMaps->fNVetPlanks[spe].push_back(UnixTime);
00334       }
00335     }
00336 
00337     if (fLoud>=2) {
00338       cout << "*Expected Planks =";
00339       for (unsigned int iplk=0; iplk<vEPlnk.size(); iplk++) {
00340         const SimplePlankEnd &spe = vEPlnk[iplk];
00341         cout << " " << spe.Plane << "-" << spe.Plank << "-" << spe.End;
00342       }
00343       cout << endl;
00344 
00345       cout << "*Vetoish Planks =";
00346       for (unsigned int iplk=0; iplk<vVetPlnk.size(); iplk++) {
00347         const SimplePlankEnd &spe = vVetPlnk[iplk];
00348         cout << " " << spe.Plane << "-" << spe.Plank << "-" << spe.End;
00349       }
00350       cout << endl;
00351     }
00352 
00353     for (unsigned int iplk=0; iplk<vEPlnk.size(); iplk++) {
00354       const SimplePlankEnd &speExp = vEPlnk[iplk];
00355       
00356       //First check if the expected plank is Vetoed
00357       if (std::find(vVetPlnk.begin(), vVetPlnk.end(), speExp) !=
00358           vVetPlnk.end()) {
00359         fPerfMaps->fNAllExpPlanks[speExp].push_back(UnixTime);
00360         fPerfMaps->fNVetExpPlanks[speExp].push_back(UnixTime);
00361 
00362         continue;
00363       }
00364 
00365       if(fLoud>=2) cout << "*Failure to find expected shield plank "
00366                         << speExp.Plane << "-" << speExp.Plank << "-"
00367                         << speExp.End << endl;
00368 
00369       bool FoundMatch = false;
00370       for (unsigned int jplk=0; jplk<vVetPlnk.size(); jplk++) {
00371         const SimplePlankEnd &speVet = vVetPlnk[jplk];
00372         
00373         //continue if this vetoed shield plane is not physically adjacent to
00374         //the expected shield plane
00375         if(!UtilShield::ShieldPlanesAdjacent(speExp.Plane, speVet.Plane))
00376           continue;
00377 
00378         if (speExp.End == speVet.End) {
00379           FoundMatch = true;
00380           if(fLoud>=2) cout << "**Matched Alternate Vetoed Plank "
00381                             << speVet.Plane << "-" << speVet.Plank << "-"
00382                             << speVet.End << endl;
00383           //Add this alternate match plank to the maps if it isn't already
00384           //expect to be vetoed
00385           if (std::find(vEPlnk.begin(), vEPlnk.end(), speVet) !=
00386               vEPlnk.end()) {
00387             fPerfMaps->fNAllExpPlanks[speVet].push_back(UnixTime);
00388             fPerfMaps->fNVetExpPlanks[speVet].push_back(UnixTime);
00389           }
00390 
00391           break;//Exit from for loop as soon as an alternate match is found
00392         }
00393         else {
00394           if(fLoud>=2) cout << "**Alternate Vetoed Plank mismatch end "
00395                             << speVet.Plane << "-" << speVet.Plank << "-"
00396                             << speVet.End << endl;
00397         }
00398       }
00399 
00400       //If no match is found, add the empty expectation
00401       if (!FoundMatch) {
00402         if(fLoud>=2) {
00403           cout << "**No Alternate Match Found Among: ";
00404           for (unsigned int jplk=0; jplk<vVetPlnk.size(); jplk++) {
00405             const SimplePlankEnd &speVet = vVetPlnk[jplk];
00406             cout << " " << speVet.Plane << "-" << speVet.Plank << "-"
00407                  << speVet.End;
00408           }
00409           cout << endl;
00410         }
00411         
00412         fPerfMaps->fNAllExpPlanks[speExp].push_back(UnixTime);
00413       }
00414     }
00415   }
00416 
00417   for (int ishw=0; ishw<ShowerList->GetEntries(); ishw++) {
00418     AtmosShower *shower = dynamic_cast<AtmosShower*>(ShowerList->At(ishw));
00419     hShowerPlanes->Fill(shower->Nplanes);
00420 
00421     std::vector<MatchPlank> vMPlnk = MatchShower(shower, ShieldPlankList);
00422 
00423     double VtxX = shower->VtxX;
00424     double VtxY = shower->VtxY;
00425     double VtxZ = shower->VtxZ;
00426     double VtxPlane = shower->VtxPlane;
00427 
00428     hShwVtxPlaneAll->Fill(VtxPlane);
00429     for (int isect=0; isect<=4; isect++) {
00430       hShwVtxXAll[isect]->Fill(VtxX);
00431       hShwVtxYAll[isect]->Fill(VtxY);
00432       hShwVtxXYAll[isect]->Fill(VtxX, VtxY);
00433     }
00434 
00435     if(fLoud>1) cout << "Shower # " << ishw
00436       << " Vtx=(" << VtxX << "," << VtxY << "," << VtxZ << ")" << endl;
00437 
00438     bool ShieldSectionVeto[5] = {false, false, false, false, false};
00439     for (unsigned int iplnk=0; iplnk<vMPlnk.size(); iplnk++) {
00440       if(fLoud>1) cout << " Match Section " << vMPlnk[iplnk].plank->Section
00441         << " DTime=(" << vMPlnk[iplnk].DTime[0] << "," << vMPlnk[iplnk].DTime[1]
00442         << ") Tcal=(" << vMPlnk[iplnk].plank->Tcal[0] << ","
00443         << vMPlnk[iplnk].plank->Tcal[1] << ")" << endl
00444         << "   QPE=("<<vMPlnk[iplnk].plank->QPE[0] << ","
00445         << vMPlnk[iplnk].plank->QPE[1] << ")"
00446         << " Qadc=("<<vMPlnk[iplnk].plank->Qadc[0] << ","
00447         << vMPlnk[iplnk].plank->Qadc[1] << ")" << endl;
00448       if ((fabs(vMPlnk[iplnk].DTime[0])<50e-9 &&
00449            vMPlnk[iplnk].plank->QPE[0]>0) ||
00450           (fabs(vMPlnk[iplnk].DTime[1])<50e-9 &&
00451            vMPlnk[iplnk].plank->QPE[1]>0)) {
00452         ShieldSectionVeto[0] = true;
00453         ShieldSectionVeto[vMPlnk[iplnk].plank->Section] = true;
00454       }
00455     }
00456 
00457     for (int isect=0; isect<=4; isect++) {
00458       if(!ShieldSectionVeto[isect]) continue;
00459 
00460       VetoEvent[isect] = true;
00461 
00462       if(isect==0) hShwVtxPlaneVet->Fill(VtxPlane);
00463       hShwVtxXVet[isect]->Fill(VtxX);
00464       hShwVtxYVet[isect]->Fill(VtxY);
00465       hShwVtxXYVet[isect]->Fill(VtxX, VtxY);
00466     }
00467   }
00468 
00469   for (int isect=0; isect<=4; isect++) {
00470     hDayAll[isect]->Fill(UnixTime);
00471     hWeekAll[isect]->Fill(UnixTime);
00472     hFNghtAll[isect]->Fill(UnixTime);
00473 
00474     if(isect==0) fNEvents++;
00475 
00476     if (VetoEvent[isect]) {
00477       hDayVet[isect]->Fill(UnixTime);
00478       hWeekVet[isect]->Fill(UnixTime);
00479       hFNghtVet[isect]->Fill(UnixTime);
00480       if(isect==0) fNVetoed++;
00481     }
00482   }
00483 
00484   return(true);
00485 }

bool AtNuShieldPerformance::FillEvent ( const AtmosEvent event  ) 

Definition at line 226 of file AtNuShieldPerformance.cxx.

References fVldContext, SimFlag::kData, Detector::kFar, AtmosEvent::NanoSec, AtmosEvent::ShieldPlankList, AtmosEvent::ShowerList, AtmosEvent::TrackList, and AtmosEvent::UnixTime.

00227 {
00228   VldTimeStamp vtime(event->UnixTime, event->NanoSec);
00229   fVldContext = new VldContext(Detector::kFar, SimFlag::kData, vtime);
00230 
00231   return FillEvent(event->ShieldPlankList,
00232                    event->TrackList,
00233                    event->ShowerList,
00234                    event->UnixTime);
00235 }

void AtNuShieldPerformance::Finish (  ) 

Definition at line 626 of file AtNuShieldPerformance.cxx.

References HistMan::Adopt(), fHName, fLoud, ShieldPerfMaps::fNAllExpPlanks, fNEvents, ShieldPerfMaps::fNVetExpPlanks, fNVetoed, ShieldPerfMaps::fNVetPlanks, Form(), fPerfMaps, fWriteMaps, hDayAll, hDayVet, hFNghtAll, hFNghtVet, hShwVtxPlaneAll, hShwVtxPlaneVet, hShwVtxXAll, hShwVtxXVet, hShwVtxXYAll, hShwVtxXYVet, hShwVtxYAll, hShwVtxYVet, hTrkVtxPlaneAll, hTrkVtxPlaneVet, hTrkVtxXAll, hTrkVtxXVet, hTrkVtxXYAll, hTrkVtxXYVet, hTrkVtxYAll, hTrkVtxYVet, hWeekAll, hWeekVet, and sSect.

00627 {
00628   if(fLoud>1) cout << "AtNuShieldPerformance::Finish" << endl;
00629 
00630   if(fNEvents == 0) return;
00631 
00632   double eff = (double)fNVetoed / fNEvents;
00633   double efferr = sqrt(eff*(1.0-eff)/fNEvents);
00634 
00635   cout << fHName << " : ";
00636   cout << "Overall efficiency = " << eff << "+-" << efferr << endl;
00637 
00638   //Write out the maps, if requested
00639   if (fWriteMaps) {
00640     cout << "Size All Planks = " << fPerfMaps->fNAllExpPlanks.size() << endl;
00641     cout << "Size Vet Planks = " << fPerfMaps->fNVetExpPlanks.size() << endl;
00642     std::map<SimplePlankEnd, std::vector<int> >::const_iterator mapitr;
00643 
00644     HistMan HMMaps(Form("ShieldPerf/%s/maps", fHName.c_str()));
00645     HMMaps.Adopt(".", fPerfMaps);
00646 
00647     cout << "All Expected Planks" << endl;
00648     for (mapitr = fPerfMaps->fNAllExpPlanks.begin();
00649          mapitr!=fPerfMaps->fNAllExpPlanks.end(); mapitr++) {
00650       const SimplePlankEnd &spe = mapitr->first;
00651       cout << " Plank = " << spe.Plane << "-" << spe.Plank << "-" << spe.End;
00652       cout << ", NExp = " << mapitr->second.size();
00653       double NAll = mapitr->second.size();
00654 
00655       std::map<SimplePlankEnd, std::vector<int> >::iterator finditr =
00656         fPerfMaps->fNVetExpPlanks.find(spe);
00657       if (finditr == fPerfMaps->fNVetExpPlanks.end()) cout << ", NVet = " << 0;
00658       else {
00659         cout << ", NVet = " << finditr->second.size();
00660         double NVet = finditr->second.size();
00661         double Eff = NVet / NAll;
00662         cout << ", Eff = " << Eff << " +- " << sqrt(Eff*(1.0-Eff)/NAll);
00663       }
00664       cout << endl;
00665     }
00666 
00667     cout << "Vetoing Planks " << endl;
00668     for (mapitr = fPerfMaps->fNVetPlanks.begin();
00669          mapitr!=fPerfMaps->fNVetPlanks.end() && fLoud>=1; mapitr++) {
00670       const SimplePlankEnd &spe = mapitr->first;
00671       cout << " Plank = " << spe.Plane << "-" << spe.Plank << "-" << spe.End;
00672       cout << ", NVetoes = " << mapitr->second.size() << endl;
00673     }
00674   }
00675 
00676   HistMan HMEff(Form("ShieldPerf/%s/eff", fHName.c_str()));
00677 
00678   TH1F *hEff = dynamic_cast<TH1F*>(hTrkVtxPlaneAll->Clone("TrkVtxPlaneEff"));
00679   hTrkVtxPlaneAll->Sumw2(); hTrkVtxPlaneVet->Sumw2();
00680   hEff->Divide(hTrkVtxPlaneVet, hTrkVtxPlaneAll, 1, 1, "B");
00681   HMEff.Adopt(".", hEff);
00682 
00683   hEff = dynamic_cast<TH1F*>(hShwVtxPlaneAll->Clone("ShwVtxPlaneEff"));
00684   hShwVtxPlaneAll->Sumw2(); hShwVtxPlaneVet->Sumw2();
00685   hEff->Divide(hShwVtxPlaneVet, hShwVtxPlaneAll, 1, 1, "B");
00686   HMEff.Adopt(".", hEff);
00687 
00688   for (int isect=0; isect<=4; isect++) {
00689     hEff = dynamic_cast<TH1F*>
00690       (hTrkVtxXAll[isect]->Clone(Form("TrkVtxXEff%s", sSect[isect])));
00691     hTrkVtxXAll[isect]->Sumw2(); hTrkVtxXVet[isect]->Sumw2();
00692     hEff->Divide(hTrkVtxXVet[isect], hTrkVtxXAll[isect], 1, 1, "B");
00693     HMEff.Adopt(".", hEff);
00694 
00695     hEff = dynamic_cast<TH1F*>
00696       (hTrkVtxYAll[isect]->Clone(Form("TrkVtxYEff%s", sSect[isect])));
00697     hTrkVtxYAll[isect]->Sumw2(); hTrkVtxYVet[isect]->Sumw2();
00698     hEff->Divide(hTrkVtxYVet[isect], hTrkVtxYAll[isect], 1, 1, "B");
00699     HMEff.Adopt(".", hEff);
00700 
00701     TH2F *h2Eff = dynamic_cast<TH2F*>
00702       (hTrkVtxXYAll[isect]->Clone(Form("TrkVtxXYEff%s", sSect[isect])));
00703     hTrkVtxXYAll[isect]->Sumw2(); hTrkVtxXYVet[isect]->Sumw2();
00704     h2Eff->Divide(hTrkVtxXYVet[isect], hTrkVtxXYAll[isect], 1, 1, "B");
00705     HMEff.Adopt(".", h2Eff);
00706 
00707     hEff = dynamic_cast<TH1F*>
00708       (hShwVtxXAll[isect]->Clone(Form("ShwVtxXEff%s", sSect[isect])));
00709     hShwVtxXAll[isect]->Sumw2(); hShwVtxXVet[isect]->Sumw2();
00710     hEff->Divide(hShwVtxXVet[isect], hShwVtxXAll[isect], 1, 1, "B");
00711     HMEff.Adopt(".", hEff);
00712 
00713     hEff = dynamic_cast<TH1F*>
00714       (hShwVtxYAll[isect]->Clone(Form("ShwVtxYEff%s", sSect[isect])));
00715     hShwVtxYAll[isect]->Sumw2(); hShwVtxYVet[isect]->Sumw2();
00716     hEff->Divide(hShwVtxYVet[isect], hShwVtxYAll[isect], 1, 1, "B");
00717     HMEff.Adopt(".", hEff);
00718 
00719     h2Eff = dynamic_cast<TH2F*>
00720       (hShwVtxXYAll[isect]->Clone(Form("ShwVtxXYEff%s", sSect[isect])));
00721     hShwVtxXYAll[isect]->Sumw2(); hShwVtxXYVet[isect]->Sumw2();
00722     h2Eff->Divide(hShwVtxXYVet[isect], hShwVtxXYAll[isect], 1, 1, "B");
00723     HMEff.Adopt(".", h2Eff);
00724 
00725     hEff = dynamic_cast<TH1F*>
00726       (hDayAll[isect]->Clone(Form("DayEff%s", sSect[isect])));
00727     hDayAll[isect]->Sumw2(); hDayVet[isect]->Sumw2();
00728     hEff->Divide(hDayVet[isect], hDayAll[isect], 1, 1, "B");
00729     HMEff.Adopt(".", hEff);
00730 
00731     hEff = dynamic_cast<TH1F*>
00732       (hWeekAll[isect]->Clone(Form("WeekEff%s", sSect[isect])));
00733     hWeekAll[isect]->Sumw2(); hWeekVet[isect]->Sumw2();
00734     hEff->Divide(hWeekVet[isect], hWeekAll[isect], 1, 1, "B");
00735     HMEff.Adopt(".", hEff);
00736 
00737     hEff = dynamic_cast<TH1F*>
00738       (hFNghtAll[isect]->Clone(Form("FNghtEff%s", sSect[isect])));
00739     hFNghtAll[isect]->Sumw2(); hFNghtVet[isect]->Sumw2();
00740     hEff->Divide(hFNghtVet[isect], hFNghtAll[isect], 1, 1, "B");
00741     HMEff.Adopt(".", hEff);
00742   }
00743 }

void AtNuShieldPerformance::Loud ( int  i  )  [inline]

Definition at line 89 of file AtNuShieldPerformance.h.

References fLoud.

00089 {fLoud=i;}

int AtNuShieldPerformance::Loud (  )  [inline]

Definition at line 88 of file AtNuShieldPerformance.h.

References fLoud.

00088 {return fLoud;}

void AtNuShieldPerformance::MakeHistos (  ) 

Definition at line 92 of file AtNuShieldPerformance.cxx.

References HistMan::Book(), MuELoss::e, fHName, fLoud, fMaxSec, fMinSec, Form(), hDayAll, hDayVet, hFNghtAll, hFNghtVet, hMaxNPlanks100nsWin, hMeanNPlanks100nsWin, hMeanPlankPE, hMeanPlankTime, hNPlanks, hPlankRate, hRMSPlankPE, hRMSPlankTime, hShowerPlanes, hShwDVtxPlankTimeAll, hShwDVtxPlankTimeBest, hShwVtxPlaneAll, hShwVtxPlaneVet, hShwVtxXAll, hShwVtxXVet, hShwVtxXYAll, hShwVtxXYVet, hShwVtxYAll, hShwVtxYVet, hTimeSpan, hTrackPlanes, hTrkDVtxPlankTimeAll, hTrkDVtxPlankTimeBest, hTrkVtxPlaneAll, hTrkVtxPlaneVet, hTrkVtxXAll, hTrkVtxXVet, hTrkVtxXYAll, hTrkVtxXYVet, hTrkVtxYAll, hTrkVtxYVet, hWeekAll, hWeekVet, sSect, and UtilHist::TH1FLogX().

00093 {
00094   std::cout << " *** AtNuShieldPerformance::MakeHistos() *** " << std::endl;
00095 
00096   if(fLoud>=2) cout << "AtNuShieldPerformance::MakeHistos" << endl;
00097   HistMan HMReco(Form("ShieldPerf/%s/reco", fHName.c_str()));
00098 
00099   hTrackPlanes = HMReco.Book<TH1F>("TrackPlanes", "", 50, 0, 200);
00100   hShowerPlanes = HMReco.Book<TH1F>("ShowerPlanes", "", 50, 0, 200);
00101 
00102   HistMan HMPlanks(Form("ShieldPerf/%s/planks", fHName.c_str()));
00103 
00104   //Loop over sections (0 == all sections)
00105   for (int isect=0; isect<=4; isect++) {
00106     hNPlanks[isect] = HMPlanks.Book<TH1F>(Form("NPlanks%s", sSect[isect]),
00107       "", 25, 0, 100);
00108     hNPlanks[isect]->GetXaxis()->SetTitle("# Shield Planks");
00109 
00110     hTimeSpan[isect] = UtilHist::TH1FLogX
00111       (Form("TimeSpan%s", sSect[isect]), "", 40, 1e-5, 1e-3);
00112     hTimeSpan[isect]->GetXaxis()->SetTitle("Shield Plank Time Range (s)");
00113     HMPlanks.Adopt(".", hTimeSpan[isect]);
00114 
00115     hPlankRate[isect] = UtilHist::TH1FLogX
00116       (Form("PlankRate%s", sSect[isect]), "", 40, 1e5, 1e7);
00117     hPlankRate[isect]->GetXaxis()->SetTitle("Shield Plank Rate (Hz)");
00118     HMPlanks.Adopt(".", hPlankRate[isect]);
00119 
00120     hMeanPlankTime[isect] = HMPlanks.Book<TH1F>
00121       (Form("MeanPlankTime%s", sSect[isect]), "", 30, -60, 60);
00122     hMeanPlankTime[isect]->GetXaxis()->SetTitle("Mean Shield Plank Time (#mus)");
00123     hRMSPlankTime[isect] = HMPlanks.Book<TH1F>
00124       (Form("RMSPlankTime%s", sSect[isect]), "", 20, 0, 60);
00125     hRMSPlankTime[isect]->GetXaxis()->SetTitle("RMS Shield Plank Time (#mus)");
00126 
00127     hMeanPlankPE[isect] = HMPlanks.Book<TH1F>
00128       (Form("MeanPlankPE%s", sSect[isect]), "", 40, 0, 10);
00129     hMeanPlankPE[isect]->GetXaxis()->SetTitle("Mean Shield Plank Charge (pe)");
00130     hRMSPlankPE[isect] = HMPlanks.Book<TH1F>
00131       (Form("RMSPlankPE%s", sSect[isect]), "", 40, 0, 10);
00132     hRMSPlankPE[isect]->GetXaxis()->SetTitle("RMS Shield Plank Charge (pe)");
00133 
00134     hMaxNPlanks100nsWin[isect] = HMPlanks.Book<TH1F>
00135       (Form("MaxNPlanks100nsWin%s", sSect[isect]), "", 10, 0, 10);
00136     hMaxNPlanks100nsWin[isect]->GetXaxis()->SetTitle
00137       ("Max Shield Planks in 100 ns Window");
00138 
00139     hMeanNPlanks100nsWin[isect] = HMPlanks.Book<TH1F>
00140       (Form("MeanNPlanks100nsWin%s", sSect[isect]), "", 30, 0, 0.3);
00141     hMeanNPlanks100nsWin[isect]->GetXaxis()->SetTitle
00142       ("Mean Shield Planks in 100 ns Window");
00143   }
00144 
00145   HistMan HMBase(Form("ShieldPerf/%s/base", fHName.c_str()));
00146   //Do the timing divisions
00147   int TimeDiv = 86400;//Seconds in a day
00148   int MinDay = TimeDiv * (fMinSec / TimeDiv);
00149   int MaxDay = TimeDiv * (1 + (fMaxSec / TimeDiv));
00150   int NBinsDay = (MaxDay-MinDay) / TimeDiv;
00151 
00152   TimeDiv = 7*86400;//Seconds in a week
00153   int MinWeek = TimeDiv * (fMinSec / TimeDiv);
00154   int MaxWeek = TimeDiv * (1 + (fMaxSec / TimeDiv));
00155   int NBinsWeek = (MaxWeek-MinWeek) / TimeDiv;
00156 
00157   TimeDiv = 14*86400;//Seconds in a fortnight
00158   int MinFNght = TimeDiv * (fMinSec / TimeDiv);
00159   int MaxFNght = TimeDiv * (1 + (fMaxSec / TimeDiv));
00160   int NBinsFNght = (MaxFNght-MinFNght) / TimeDiv;
00161 
00162   hTrkVtxPlaneAll = HMBase.Book<TH1F>("TrkVtxPlaneAll","", 122, 0, 488);
00163   hTrkVtxPlaneVet = HMBase.Book<TH1F>("TrkVtxPlaneVet","", 122, 0, 488);
00164 
00165   hShwVtxPlaneAll = HMBase.Book<TH1F>("ShwVtxPlaneAll","", 122, 0, 488);
00166   hShwVtxPlaneVet = HMBase.Book<TH1F>("ShwVtxPlaneVet","", 122, 0, 488);
00167 
00168   for (int isect=0; isect<=4; isect++) {
00169     hTrkVtxXAll[isect] = HMBase.Book<TH1F>(Form("TrkVtxXAll%s", sSect[isect]),
00170       "", 20,-3.5,3.5);
00171     hTrkVtxXVet[isect] = HMBase.Book<TH1F>(Form("TrkVtxXVet%s", sSect[isect]),
00172       "", 20,-3.5,3.5);
00173 
00174     hTrkVtxYAll[isect] = HMBase.Book<TH1F>(Form("TrkVtxYAll%s", sSect[isect]),
00175       "", 20,-3.5,3.5);
00176     hTrkVtxYVet[isect] = HMBase.Book<TH1F>(Form("TrkVtxYVet%s", sSect[isect]),
00177       "", 20,-3.5,3.5);
00178 
00179     hTrkVtxXYAll[isect] = HMBase.Book<TH2F>(Form("TrkVtxXYAll%s", sSect[isect]),
00180       "", 10,-3.5,3.5, 10,-3.5,3.5);
00181     hTrkVtxXYVet[isect] = HMBase.Book<TH2F>(Form("TrkVtxXYVet%s", sSect[isect]),
00182       "", 10,-3.5,3.5, 10,-3.5,3.5);
00183 
00184     hShwVtxXAll[isect] = HMBase.Book<TH1F>(Form("ShwVtxXAll%s", sSect[isect]),
00185       "", 20,-3.5,3.5);
00186     hShwVtxXVet[isect] = HMBase.Book<TH1F>(Form("ShwVtxXVet%s", sSect[isect]),
00187       "", 20,-3.5,3.5);
00188 
00189     hShwVtxYAll[isect] = HMBase.Book<TH1F>(Form("ShwVtxYAll%s", sSect[isect]),
00190       "", 20,-3.5,3.5);
00191     hShwVtxYVet[isect] = HMBase.Book<TH1F>(Form("ShwVtxYVet%s", sSect[isect]),
00192       "", 20,-3.5,3.5);
00193 
00194     hShwVtxXYAll[isect] = HMBase.Book<TH2F>(Form("ShwVtxXYAll%s", sSect[isect]),
00195       "", 10,-3.5,3.5, 10,-3.5,3.5);
00196     hShwVtxXYVet[isect] = HMBase.Book<TH2F>(Form("ShwVtxXYVet%s", sSect[isect]),
00197       "", 10,-3.5,3.5, 10,-3.5,3.5);
00198 
00199     hDayAll[isect] = HMBase.Book<TH1F>(Form("DayAll%s", sSect[isect]),
00200       "", NBinsDay, MinDay, MaxDay);
00201     hDayVet[isect] = HMBase.Book<TH1F>(Form("DayVet%s", sSect[isect]),
00202       "", NBinsDay, MinDay, MaxDay);
00203 
00204     hWeekAll[isect] = HMBase.Book<TH1F>(Form("WeekAll%s", sSect[isect]),
00205       "", NBinsWeek, MinWeek, MaxWeek);
00206     hWeekVet[isect] = HMBase.Book<TH1F>(Form("WeekVet%s", sSect[isect]),
00207       "", NBinsWeek, MinWeek, MaxWeek);
00208 
00209     hFNghtAll[isect] = HMBase.Book<TH1F>(Form("FNghtAll%s", sSect[isect]),
00210       "", NBinsFNght, MinFNght, MaxFNght);
00211     hFNghtVet[isect] = HMBase.Book<TH1F>(Form("FNghtVet%s", sSect[isect]),
00212       "", NBinsFNght, MinFNght, MaxFNght);
00213   }
00214 
00215   HistMan HMTiming(Form("ShieldPerf/%s/timing", fHName.c_str()));
00216   hShwDVtxPlankTimeAll = HMTiming.Book<TH1F>("ShwDVtxPlankTimeAll", "",
00217     100,-500,500);
00218   hTrkDVtxPlankTimeAll = HMTiming.Book<TH1F>("TrkDVtxPlankTimeAll", "",
00219     100,-500,500);
00220   hShwDVtxPlankTimeBest = HMTiming.Book<TH1F>("ShwDVtxPlankTimeBest", "",
00221     100,-500,500);
00222   hTrkDVtxPlankTimeBest = HMTiming.Book<TH1F>("TrkDVtxPlankTimeBest", "",
00223     100,-500,500);
00224 }

std::vector< MatchPlank > AtNuShieldPerformance::MatchShower ( AtmosShower ,
TClonesArray *   
) [private]

Definition at line 829 of file AtNuShieldPerformance.cxx.

References MatchPlank::DTime, MuELoss::e, fClearFibreN, fWlsFibreN, and MatchPlank::plank.

Referenced by FillEvent().

00830 {
00831   assert(shower);
00832   assert(ShieldPlankList);
00833 
00834   std::vector<MatchPlank> MatchedPlanks;
00835 
00836   double topvtxX = shower->VtxX; 
00837   double topvtxY = shower->VtxY; 
00838   double topvtxZ = shower->VtxZ;
00839   double topvtxtime = shower->VtxTime; 
00840 
00841   const int nplanks = (int)(ShieldPlankList->GetEntries());
00842   for (int iplnk = 0; iplnk<nplanks; iplnk++) {
00843     AtmosShieldPlank* plank =
00844       dynamic_cast<AtmosShieldPlank*>
00845       (ShieldPlankList->At(iplnk));
00846     assert(plank);
00847 
00848     if (plank->Z[0]+0.5>topvtxZ &&
00849         plank->Z[1]-0.5<topvtxZ &&
00850         plank->Y>topvtxY-0.5 ){
00851       double travelDT = (1.0/3.0e8)*sqrt(
00852         (plank->X-topvtxX)*(plank->X-topvtxX) +
00853         (plank->Y-topvtxY)*(plank->Y-topvtxY) );
00854       MatchPlank mplnk;
00855       mplnk.plank = plank;
00856       for (unsigned int iend=0; iend<2; iend++) {
00857         mplnk.DTime[iend]  = plank->Tcal[iend] + 26e-9;
00858         mplnk.DTime[iend] -= plank->WlsPigtail[iend]*fWlsFibreN/3e8;
00859         mplnk.DTime[iend] -= plank->ClearFibre[iend]*fClearFibreN/3e8;
00860         mplnk.DTime[iend] -= TMath::Abs(topvtxZ-plank->Z[iend])*fWlsFibreN/3e8;
00861         mplnk.DTime[iend] += travelDT;
00862         mplnk.DTime[iend] -= topvtxtime;
00863       }
00864       MatchedPlanks.push_back(mplnk);
00865     }
00866   }
00867 
00868   return MatchedPlanks;
00869 }

std::vector< MatchPlank > AtNuShieldPerformance::MatchTrack ( AtmosTrack ,
TClonesArray *   
) [private]

Definition at line 746 of file AtNuShieldPerformance.cxx.

References MatchPlank::DTime, MuELoss::e, fClearFibreN, fWlsFibreN, and MatchPlank::plank.

Referenced by FillEvent().

00747 {
00748   assert(track);
00749   assert(ShieldPlankList);
00750 
00751   std::vector<MatchPlank> MatchedPlanks;
00752 
00753   double topvtxX = 0.0;
00754   double topvtxY = 0.0;
00755   double topvtxZ = -999.9;
00756   double topvtxtime = 0.0;
00757 
00758   double shldminU = -999.9;
00759   double shldmaxU = +999.9;
00760   double shldminV = -999.9;
00761   double shldmaxV = +999.9;
00762   double shldminX = -999.9;
00763   double shldmaxX = +999.9;
00764   double shldminY = -999.9;
00765   double shldmaxY = +999.9;
00766 
00767   if (track->VtxY >= track->EndY){
00768     topvtxX = track->VtxX; 
00769     topvtxY = track->VtxY; 
00770     topvtxZ = track->VtxZ;
00771     topvtxtime = track->VtxTime; 
00772     if(track->EndX>+3.5) shldmaxX = +4.5;
00773     if(track->EndX<-3.5) shldminX = -4.5;
00774     if(track->EndU<-3.5) shldminU = -4.5;
00775     if(track->EndV<-3.5) shldminV = -4.5;
00776     shldminY = track->VtxY-0.1;
00777   } 
00778   else{
00779     topvtxX = track->EndX; 
00780     topvtxY = track->EndY; 
00781     topvtxZ = track->EndZ;
00782     topvtxtime = track->EndTime; 
00783     if(track->VtxX>+3.5) shldmaxX = +4.5;
00784     if(track->VtxX<-3.5) shldminX = -4.5;
00785     if(track->VtxU<-3.5) shldminU = -4.5;
00786     if(track->VtxV<-3.5) shldminV = -4.5;
00787     shldminY = track->EndY-0.1;
00788   }
00789 
00790   const int nplanks = (int)(ShieldPlankList->GetEntries());
00791   for (int iplnk = 0; iplnk<nplanks; iplnk++) {
00792     AtmosShieldPlank* plank =
00793       dynamic_cast<AtmosShieldPlank*>
00794       (ShieldPlankList->At(iplnk));
00795     assert(plank);
00796 
00797     double plankU = 0.7071*(+plank->X+plank->Y);
00798     double plankV = 0.7071*(-plank->X+plank->Y);
00799     double plankX = plank->X;
00800     double plankY = plank->Y;
00801 
00802     if (plank->Z[0]+0.5>topvtxZ  &&
00803         plank->Z[1]-0.5<topvtxZ &&
00804         plankU>shldminU && plankU<shldmaxU &&
00805         plankV>shldminV && plankV<shldmaxV &&
00806         plankX>shldminX && plankX<shldmaxX &&
00807         plankY>shldminY && plankY<shldmaxY){
00808       double travelDT = (1.0/3.0e8)*sqrt(
00809         (plank->X-topvtxX)*(plank->X-topvtxX) +
00810         (plank->Y-topvtxY)*(plank->Y-topvtxY) );
00811       MatchPlank mplnk;
00812       mplnk.plank = plank;
00813       for (unsigned int iend=0; iend<2; iend++) {
00814         mplnk.DTime[iend]  = plank->Tcal[iend] + 26e-9;
00815         mplnk.DTime[iend] -= plank->WlsPigtail[iend]*fWlsFibreN/3e8;
00816         mplnk.DTime[iend] -= plank->ClearFibre[iend]*fClearFibreN/3e8;
00817         mplnk.DTime[iend] -= TMath::Abs(topvtxZ-plank->Z[iend])*fWlsFibreN/3e8;
00818         mplnk.DTime[iend] += travelDT;
00819         mplnk.DTime[iend] -= topvtxtime;
00820       }
00821       MatchedPlanks.push_back(mplnk);
00822     }
00823   }
00824 
00825   return MatchedPlanks;
00826 }

void AtNuShieldPerformance::MaxSec ( int  i  )  [inline]

Definition at line 95 of file AtNuShieldPerformance.h.

References fMaxSec.

00095 {fMaxSec=i;}

int AtNuShieldPerformance::MaxSec (  )  [inline]

Definition at line 94 of file AtNuShieldPerformance.h.

References fMaxSec.

00094 {return fMaxSec;}

void AtNuShieldPerformance::MinSec ( int  i  )  [inline]

Definition at line 92 of file AtNuShieldPerformance.h.

References fMinSec.

00092 {fMinSec=i;}

int AtNuShieldPerformance::MinSec (  )  [inline]

Definition at line 91 of file AtNuShieldPerformance.h.

References fMinSec.

00091 {return fMinSec;}

void AtNuShieldPerformance::Reset (  ) 

Definition at line 75 of file AtNuShieldPerformance.cxx.

References fLoud, ShieldPerfMaps::fNAllExpPlanks, fNEvents, ShieldPerfMaps::fNVetExpPlanks, fNVetoed, ShieldPerfMaps::fNVetPlanks, and fPerfMaps.

Referenced by AtNuShieldPerformance().

00076 {
00077   if(fLoud>=2) cout << "AtNuShieldPerformance::Reset" << endl;
00078 
00079   fNEvents = 0;
00080   fNVetoed = 0;
00081 
00082   fPerfMaps->fNVetPlanks.clear();
00083   fPerfMaps->fNAllExpPlanks.clear();
00084   fPerfMaps->fNVetExpPlanks.clear();
00085 }

void AtNuShieldPerformance::WriteMaps ( bool  i  )  [inline]

Definition at line 98 of file AtNuShieldPerformance.h.

References fWriteMaps.

00098 {fWriteMaps=i;}

bool AtNuShieldPerformance::WriteMaps (  )  [inline]

Definition at line 97 of file AtNuShieldPerformance.h.

References fWriteMaps.

00097 {return fWriteMaps;}


Member Data Documentation

std::string AtNuShieldPerformance::fHName [private]

Definition at line 119 of file AtNuShieldPerformance.h.

Referenced by AtNuShieldPerformance(), Finish(), and MakeHistos().

int AtNuShieldPerformance::fLoud [private]

Definition at line 102 of file AtNuShieldPerformance.h.

Referenced by AtNuShieldPerformance(), FillEvent(), Finish(), Loud(), MakeHistos(), Reset(), and ~AtNuShieldPerformance().

int AtNuShieldPerformance::fMaxSec [private]

Definition at line 107 of file AtNuShieldPerformance.h.

Referenced by AtNuShieldPerformance(), MakeHistos(), and MaxSec().

int AtNuShieldPerformance::fMinSec [private]

Definition at line 106 of file AtNuShieldPerformance.h.

Referenced by AtNuShieldPerformance(), MakeHistos(), and MinSec().

int AtNuShieldPerformance::fNEvents [private]

Definition at line 110 of file AtNuShieldPerformance.h.

Referenced by FillEvent(), Finish(), and Reset().

int AtNuShieldPerformance::fNVetoed [private]

Definition at line 111 of file AtNuShieldPerformance.h.

Referenced by FillEvent(), Finish(), and Reset().

ShieldPerfMaps* AtNuShieldPerformance::fPerfMaps [private]

Definition at line 121 of file AtNuShieldPerformance.h.

Referenced by AtNuShieldPerformance(), FillEvent(), Finish(), and Reset().

ShieldGeom* AtNuShieldPerformance::fShGeom [private]

Definition at line 113 of file AtNuShieldPerformance.h.

Referenced by AtNuShieldPerformance().

VldContext* AtNuShieldPerformance::fVldContext [private]

Definition at line 114 of file AtNuShieldPerformance.h.

Referenced by AtNuShieldPerformance(), and FillEvent().

int AtNuShieldPerformance::fWriteMaps [private]

Definition at line 104 of file AtNuShieldPerformance.h.

Referenced by FillEvent(), Finish(), and WriteMaps().

TH1F* AtNuShieldPerformance::hDayAll[5] [private]

Definition at line 145 of file AtNuShieldPerformance.h.

Referenced by FillEvent(), Finish(), and MakeHistos().

TH1F * AtNuShieldPerformance::hDayVet[5] [private]

Definition at line 145 of file AtNuShieldPerformance.h.

Referenced by FillEvent(), Finish(), and MakeHistos().

TH1F* AtNuShieldPerformance::hFNghtAll[5] [private]

Definition at line 147 of file AtNuShieldPerformance.h.

Referenced by FillEvent(), Finish(), and MakeHistos().

TH1F * AtNuShieldPerformance::hFNghtVet[5] [private]

Definition at line 147 of file AtNuShieldPerformance.h.

Referenced by FillEvent(), Finish(), and MakeHistos().

TH1F* AtNuShieldPerformance::hMaxNPlanks100nsWin[5] [private]

Definition at line 132 of file AtNuShieldPerformance.h.

Referenced by EvalShieldPlanks(), and MakeHistos().

TH1F* AtNuShieldPerformance::hMeanNPlanks100nsWin[5] [private]

Definition at line 133 of file AtNuShieldPerformance.h.

Referenced by EvalShieldPlanks(), and MakeHistos().

TH1F* AtNuShieldPerformance::hMeanPlankPE[5] [private]

Definition at line 131 of file AtNuShieldPerformance.h.

Referenced by EvalShieldPlanks(), and MakeHistos().

TH1F* AtNuShieldPerformance::hMeanPlankTime[5] [private]

Definition at line 130 of file AtNuShieldPerformance.h.

Referenced by EvalShieldPlanks(), and MakeHistos().

TH1F* AtNuShieldPerformance::hNPlanks[5] [private]

Definition at line 127 of file AtNuShieldPerformance.h.

Referenced by EvalShieldPlanks(), and MakeHistos().

TH1F* AtNuShieldPerformance::hPlankRate[5] [private]

Definition at line 129 of file AtNuShieldPerformance.h.

Referenced by EvalShieldPlanks(), and MakeHistos().

TH1F * AtNuShieldPerformance::hRMSPlankPE[5] [private]

Definition at line 131 of file AtNuShieldPerformance.h.

Referenced by EvalShieldPlanks(), and MakeHistos().

TH1F * AtNuShieldPerformance::hRMSPlankTime[5] [private]

Definition at line 130 of file AtNuShieldPerformance.h.

Referenced by EvalShieldPlanks(), and MakeHistos().

TH1F* AtNuShieldPerformance::hShowerPlanes [private]

Definition at line 124 of file AtNuShieldPerformance.h.

Referenced by FillEvent(), and MakeHistos().

TH1F* AtNuShieldPerformance::hShwDVtxPlankTimeAll [private]

Definition at line 149 of file AtNuShieldPerformance.h.

Referenced by MakeHistos().

TH1F* AtNuShieldPerformance::hShwDVtxPlankTimeBest [private]

Definition at line 151 of file AtNuShieldPerformance.h.

Referenced by MakeHistos().

TH1F* AtNuShieldPerformance::hShwVtxPlaneAll [private]

Definition at line 140 of file AtNuShieldPerformance.h.

Referenced by FillEvent(), Finish(), and MakeHistos().

TH1F * AtNuShieldPerformance::hShwVtxPlaneVet [private]

Definition at line 140 of file AtNuShieldPerformance.h.

Referenced by FillEvent(), Finish(), and MakeHistos().

TH1F* AtNuShieldPerformance::hShwVtxXAll[5] [private]

Definition at line 141 of file AtNuShieldPerformance.h.

Referenced by FillEvent(), Finish(), and MakeHistos().

TH1F * AtNuShieldPerformance::hShwVtxXVet[5] [private]

Definition at line 141 of file AtNuShieldPerformance.h.

Referenced by FillEvent(), Finish(), and MakeHistos().

TH2F* AtNuShieldPerformance::hShwVtxXYAll[5] [private]

Definition at line 143 of file AtNuShieldPerformance.h.

Referenced by FillEvent(), Finish(), and MakeHistos().

TH2F * AtNuShieldPerformance::hShwVtxXYVet[5] [private]

Definition at line 143 of file AtNuShieldPerformance.h.

Referenced by FillEvent(), Finish(), and MakeHistos().

TH1F* AtNuShieldPerformance::hShwVtxYAll[5] [private]

Definition at line 142 of file AtNuShieldPerformance.h.

Referenced by FillEvent(), Finish(), and MakeHistos().

TH1F * AtNuShieldPerformance::hShwVtxYVet[5] [private]

Definition at line 142 of file AtNuShieldPerformance.h.

Referenced by FillEvent(), Finish(), and MakeHistos().

TH1F* AtNuShieldPerformance::hTimeSpan[5] [private]

Definition at line 128 of file AtNuShieldPerformance.h.

Referenced by EvalShieldPlanks(), and MakeHistos().

TH1F* AtNuShieldPerformance::hTrackPlanes [private]

Definition at line 123 of file AtNuShieldPerformance.h.

Referenced by FillEvent(), and MakeHistos().

TH1F* AtNuShieldPerformance::hTrkDVtxPlankTimeAll [private]

Definition at line 150 of file AtNuShieldPerformance.h.

Referenced by MakeHistos().

TH1F* AtNuShieldPerformance::hTrkDVtxPlankTimeBest [private]

Definition at line 152 of file AtNuShieldPerformance.h.

Referenced by MakeHistos().

TH1F* AtNuShieldPerformance::hTrkVtxPlaneAll [private]

Definition at line 135 of file AtNuShieldPerformance.h.

Referenced by FillEvent(), Finish(), and MakeHistos().

TH1F * AtNuShieldPerformance::hTrkVtxPlaneVet [private]

Definition at line 135 of file AtNuShieldPerformance.h.

Referenced by FillEvent(), Finish(), and MakeHistos().

TH1F* AtNuShieldPerformance::hTrkVtxXAll[5] [private]

Definition at line 136 of file AtNuShieldPerformance.h.

Referenced by FillEvent(), Finish(), and MakeHistos().

TH1F * AtNuShieldPerformance::hTrkVtxXVet[5] [private]

Definition at line 136 of file AtNuShieldPerformance.h.

Referenced by FillEvent(), Finish(), and MakeHistos().

TH2F* AtNuShieldPerformance::hTrkVtxXYAll[5] [private]

Definition at line 138 of file AtNuShieldPerformance.h.

Referenced by FillEvent(), Finish(), and MakeHistos().

TH2F * AtNuShieldPerformance::hTrkVtxXYVet[5] [private]

Definition at line 138 of file AtNuShieldPerformance.h.

Referenced by FillEvent(), Finish(), and MakeHistos().

TH1F* AtNuShieldPerformance::hTrkVtxYAll[5] [private]

Definition at line 137 of file AtNuShieldPerformance.h.

Referenced by FillEvent(), Finish(), and MakeHistos().

TH1F * AtNuShieldPerformance::hTrkVtxYVet[5] [private]

Definition at line 137 of file AtNuShieldPerformance.h.

Referenced by FillEvent(), Finish(), and MakeHistos().

TH1F* AtNuShieldPerformance::hWeekAll[5] [private]

Definition at line 146 of file AtNuShieldPerformance.h.

Referenced by FillEvent(), Finish(), and MakeHistos().

TH1F * AtNuShieldPerformance::hWeekVet[5] [private]

Definition at line 146 of file AtNuShieldPerformance.h.

Referenced by FillEvent(), Finish(), and MakeHistos().


The documentation for this class was generated from the following files:
Generated on Thu Apr 10 23:02:12 2014 for loon by  doxygen 1.4.7