Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

VetoTrack Class Reference

#include <VetoTrack.h>

List of all members.

Public Member Functions

 ~VetoTrack ()
 VetoTrack ()
 VetoTrack (const AtmosEvent *event)
 VetoTrack (const AtmosTrack *track, const TClonesArray *ShieldPlankList)
void Zero ()
void Fill (const AtmosEvent *event)
void Fill (const AtmosTrack *track, const TClonesArray *ShieldPlankList)

Public Attributes

double SectionQInTime [4]
double SectionQOutTime [4]
double VetoQCorrSS
int NInTimePlanks
TClonesArray * InTimePlanks


Constructor & Destructor Documentation

VetoTrack::~VetoTrack  ) 
 

Definition at line 41 of file VetoTrack.cxx.

00041                       {
00042   //if(InTimePlanes) delete [] InTimePlanes; InTimePlanes = 0;
00043   //if(SteelToPlanks) delete [] SteelToPlanks; SteelToPlanks = 0;
00044   //if(ZToPlanks) delete [] ZToPlanks; ZToPlanks = 0;
00045   //if(PEPlanks) delete [] PEPlanks; PEPlanks = 0;
00046   delete InTimePlanks;
00047 }

VetoTrack::VetoTrack  ) 
 

Definition at line 49 of file VetoTrack.cxx.

References InTimePlanks, and Zero().

00049                      {
00050   InTimePlanks = new TClonesArray("PlankToTrk");
00051   Zero();
00052 }

VetoTrack::VetoTrack const AtmosEvent event  ) 
 

Definition at line 54 of file VetoTrack.cxx.

References Fill(), InTimePlanks, and Zero().

00054                                             {
00055   InTimePlanks = new TClonesArray("PlankToTrk");
00056   Zero();
00057   Fill(event);
00058 }

VetoTrack::VetoTrack const AtmosTrack track,
const TClonesArray *  ShieldPlankList
 

Definition at line 60 of file VetoTrack.cxx.

References Fill(), InTimePlanks, and Zero().

00061                                                           {
00062   InTimePlanks = new TClonesArray("PlankToTrk");
00063   Zero();
00064   Fill(track, ShieldPlankList);
00065 }


Member Function Documentation

void VetoTrack::Fill const AtmosTrack track,
const TClonesArray *  ShieldPlankList
 

Definition at line 94 of file VetoTrack.cxx.

References C, AtmosShieldPlank::ClearFibre, ClearFibreN, UtilMisc::DetectorWall(), MSG, NInTimePlanks, AtmosShieldPlank::QPE, AtmosShieldPlank::Section, AtmosShieldPlank::Tcal, VetoQCorrSS, AtmosTrack::VtxTime, AtmosTrack::VtxX, AtmosTrack::VtxY, AtmosTrack::VtxZ, WlsFibreN, AtmosShieldPlank::WlsPigtail, AtmosShieldPlank::X, AtmosShieldPlank::Y, and AtmosShieldPlank::Z.

00095                                                           {
00096   assert(track);
00097   assert(ShieldPlankList);
00098 
00099   //project track vertex back to the shield
00100   const double VtxX = track->VtxX;
00101   const double VtxY = track->VtxY;
00102   const double VtxZ = track->VtxZ;
00103   const double VtxTime = track->VtxTime;
00104 
00105   //Which sections of the shield do we care about?
00106   int vtx_section(0);
00107   if (VtxZ>0.0 && VtxZ<15) {//sm1
00108     if(VtxZ<8.5) vtx_section|=1;
00109     if(VtxZ>6.9) vtx_section|=2;
00110   }
00111   else if (VtxZ>15.5 && VtxZ<31.0) {//sm2
00112     if(VtxZ<23.9) vtx_section|=4;
00113     if(VtxZ>21.8) vtx_section|=8;
00114   }
00115 
00116   const int nplanks = (int)(ShieldPlankList->GetEntries());
00117   double DTime[2] = {0., 0.};
00118   for (int iplnk = 0; iplnk< nplanks; ++iplnk) {
00119     const AtmosShieldPlank* plank =
00120       dynamic_cast<const AtmosShieldPlank*>
00121       (ShieldPlankList->At(iplnk));
00122     assert(plank);
00123 
00124     //Delta T Vtx
00125     for (unsigned int iend=0; iend<2; iend++) {
00126       DTime[iend] = plank->Tcal[iend];
00127       DTime[iend] -= plank->WlsPigtail[iend]*WlsFibreN/TMath::C();
00128       DTime[iend] -= plank->ClearFibre[iend]*ClearFibreN/TMath::C();
00129       DTime[iend] -= TMath::Abs(VtxZ-plank->Z[iend])*WlsFibreN/TMath::C();
00130     }
00131 
00132     //Add to veto counts if shield hit is in-time with event
00133     if ((plank->QPE[0]>0 && TMath::Abs(DTime[0]-VtxTime)<TimeWin) ||
00134         (plank->QPE[1]>0 && TMath::Abs(DTime[1]-VtxTime)<TimeWin)) {
00135 
00136       if ((1<<(plank->Section-1)&(vtx_section))) {
00137         VetoQCorrSS += plank->QPE[0]+plank->QPE[1];
00138       }
00139 
00140       bool TrkUnderPlank(false);
00141       if(plank->Z[0] < plank->Z[1]) 
00142         TrkUnderPlank =
00143           (plank->Z[0] < VtxZ && VtxZ < plank->Z[1]);
00144       else
00145         TrkUnderPlank =
00146           (plank->Z[1] < VtxZ && VtxZ < plank->Z[0]);
00147 
00148       double DZ(0.);
00149       if(!TrkUnderPlank) DZ = TMath::Min(TMath::Abs(plank->Z[0]-VtxZ),
00150                                          TMath::Abs(plank->Z[1]-VtxZ));
00151       //ztp.push_back(DZ);
00152       
00153       double SteelToPlank(0.);
00154       double RP(0.);
00155       if (!TrkUnderPlank) {
00156         RP = TMath::Sqrt((DZ*DZ) + 
00157                ((plank->X-VtxX)*(plank->X-VtxX)) +
00158                ((plank->X-VtxX)*(plank->X-VtxX)) );
00159         double TrkVtx[3] = {VtxX, VtxY, VtxZ};
00160         double TrkCos[3];
00161         TrkCos[0] = (plank->X-VtxX) / RP;
00162         TrkCos[1] = (plank->Y-VtxY) / RP;
00163         TrkCos[2] = (DZ) / RP;
00164         double DetVtx[3];
00165         int Side = UtilMisc::DetectorWall(TrkVtx, TrkCos, DetVtx);
00166         if (Side==9 || Side==10) {
00167           MSG("VetoTrack",Msg::kDebug) << "Cross on SM Gap" << endl;
00168         }
00169         SteelToPlank = TMath::Abs((TrkVtx[2]-DetVtx[2])/TrkCos[2]);
00170         SteelToPlank = SteelToPlank * 2.54 / 5.99;
00171       }
00172       //stp.push_back(SteelToPlank);
00173       new((*InTimePlanks)[NInTimePlanks++]) PlankToTrk(plank, DZ, SteelToPlank);
00174 
00175       /*
00176       for (int i=0; i<10; i++) {
00177         if (SteelToPlank <= i*0.1) {
00178           VetoQPlank10cmSteel[i] += plank->QPE[0]+plank->QPE[1];
00179         }
00180       }
00181 
00182       for (int i=0; i<10; i++) {
00183         if (DZ <= i*0.5) {
00184           VetoQPlank50cmZ[i] += plank->QPE[0]+plank->QPE[1];
00185         }
00186       }
00187       */
00188     }
00189   }
00190 }

void VetoTrack::Fill const AtmosEvent event  ) 
 

Definition at line 82 of file VetoTrack.cxx.

References AtmosEvent::NShieldPlanks, AtmosEvent::ShieldPlankList, and AtmosEvent::TrackList.

Referenced by VetoTrack().

00082                                             {
00083   //This assumes a single track over which to find the veto correlation
00084   const AtmosTrack* track =
00085     dynamic_cast<const AtmosTrack*>(event->TrackList->At(0));
00086   if(!track) return;
00087 
00088   if(event->NShieldPlanks == 0) return;
00089   if(!(event->ShieldPlankList)) return;
00090 
00091   Fill(track, event->ShieldPlankList);
00092 }

void VetoTrack::Zero  ) 
 

Definition at line 67 of file VetoTrack.cxx.

References InTimePlanks, NInTimePlanks, SectionQInTime, SectionQOutTime, and VetoQCorrSS.

Referenced by VetoTrack().

00067                      {
00068   memset(SectionQInTime, 0, 4*sizeof(double));
00069   memset(SectionQOutTime, 0, 4*sizeof(double));
00070 
00071   VetoQCorrSS = 0;
00072 
00073   //memset(VetoQPlank50cmZ, 0, 10*sizeof(double));
00074   //memset(VetoQPlank10cmSteel, 0, 10*sizeof(double));
00075   for (int i=0; i<1+InTimePlanks->GetLast(); i++){
00076     InTimePlanks->At(i)->Clear();
00077   }
00078   InTimePlanks->Delete();
00079   NInTimePlanks = 0;
00080 }


Member Data Documentation

TClonesArray* VetoTrack::InTimePlanks
 

Definition at line 45 of file VetoTrack.h.

Referenced by VetoTrack(), and Zero().

int VetoTrack::NInTimePlanks
 

Definition at line 44 of file VetoTrack.h.

Referenced by Fill(), and Zero().

double VetoTrack::SectionQInTime[4]
 

Definition at line 39 of file VetoTrack.h.

Referenced by Zero().

double VetoTrack::SectionQOutTime[4]
 

Definition at line 40 of file VetoTrack.h.

Referenced by Zero().

double VetoTrack::VetoQCorrSS
 

Definition at line 42 of file VetoTrack.h.

Referenced by Fill(), and Zero().


The documentation for this class was generated from the following files:
Generated on Mon Feb 15 11:10:29 2010 for loon by  doxygen 1.3.9.1