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

Public Member Functions | |
| AlgEventSR () | |
| virtual | ~AlgEventSR () |
| virtual void | RunAlg (AlgConfig &ac, CandHandle &ch, CandContext &cx) |
| virtual void | Trace (const char *c) const |
|
|
Definition at line 49 of file AlgEventSR.cxx. 00050 {
00051 }
|
|
|
Definition at line 54 of file AlgEventSR.cxx. 00055 {
00056 }
|
|
||||||||||||||||
|
Implements AlgBase. Definition at line 59 of file AlgEventSR.cxx. References CandHandle::AddDaughterLink(), CandEventHandle::AddShower(), CandEventHandle::AddTrack(), AlgReco::Calibrate(), VertexFinder::FindVertex(), CandContext::GetDataIn(), CandHandle::GetDaughterIterator(), Registry::GetDouble(), CandRecoHandle::GetEndDirCosU(), CandRecoHandle::GetEndDirCosV(), CandRecoHandle::GetEndDirCosZ(), CandRecoHandle::GetEndT(), CandRecoHandle::GetEndU(), CandRecoHandle::GetEndV(), CandRecoHandle::GetEndZ(), CandShowerHandle::GetEnergy(), MomNavigator::GetFragment(), Registry::GetInt(), CandContext::GetMom(), CandTrackHandle::GetMomentum(), CandEventHandle::GetPrimaryShower(), CandEventHandle::GetPrimaryTrack(), CandRecoHandle::GetTermPlane(), RecMinos::GetVldContext(), CandRecoHandle::GetVtxDirCosU(), CandRecoHandle::GetVtxDirCosV(), CandRecoHandle::GetVtxDirCosZ(), CandRecoHandle::GetVtxPlane(), CandRecoHandle::GetVtxT(), CandRecoHandle::GetVtxU(), CandRecoHandle::GetVtxV(), CandRecoHandle::GetVtxZ(), CandShowerHandle::IsContained(), CandTrackHandle::IsContained(), MSG, CandEventHandle::SetContained(), CandRecoHandle::SetEndDirCosU(), CandRecoHandle::SetEndDirCosV(), CandRecoHandle::SetEndDirCosZ(), CandRecoHandle::SetEndPlane(), CandRecoHandle::SetEndT(), CandRecoHandle::SetEndU(), CandRecoHandle::SetEndV(), CandRecoHandle::SetEndZ(), CandEventHandle::SetEnergy(), CandEventHandle::SetPrimaryShower(), CandEventHandle::SetPrimaryTrack(), CandRecoHandle::SetVtxDirCosU(), CandRecoHandle::SetVtxDirCosV(), CandRecoHandle::SetVtxDirCosZ(), CandRecoHandle::SetVtxPlane(), CandRecoHandle::SetVtxT(), CandRecoHandle::SetVtxU(), CandRecoHandle::SetVtxV(), CandRecoHandle::SetVtxZ(), VertexFinder::VtxPlane(), VertexFinder::VtxU(), VertexFinder::VtxV(), and VertexFinder::VtxZ(). 00060 {
00061
00062 // get alg parameters
00063 Double_t shwshwdz = ac.GetDouble("ShwShwDz");
00064 Double_t minShwEFract = ac.GetDouble("MinShwEFract");
00065 Double_t isCosmic = ac.GetInt("IsCosmic");
00066
00067 // check that all is well with inputs
00068
00069 const CandRecord* candrec = dynamic_cast<CandRecord*>
00070 (cx.GetMom()->GetFragment("CandRecord", "PrimaryCandidateRecord"));
00071 if (candrec==0) {
00072 MSG("EventSR", Msg::kWarning)
00073 << "No PrimaryCandidateRecord in MOM." << endl;
00074 }
00075 assert(candrec);
00076 const VldContext *vldcptr = candrec->GetVldContext();
00077 assert(vldcptr);
00078 assert(ch.InheritsFrom("CandEventHandle"));
00079 CandEventHandle &ceh = dynamic_cast<CandEventHandle &>(ch);
00080 assert(cx.GetDataIn());
00081 assert(cx.GetDataIn()->InheritsFrom("TObjArray"));
00082 const TObjArray *tary =
00083 dynamic_cast<const TObjArray*>(cx.GetDataIn());
00084 assert(tary->GetLast()>=0);
00085
00086
00087 // construct daughter strip list, and track and shower lists
00088 for (Int_t i=0; i<=tary->GetLast(); i++) {
00089 TObject *tobj = tary->At(i);
00090 assert(tobj->InheritsFrom("CandRecoHandle"));
00091 CandRecoHandle *recohandle = dynamic_cast<CandRecoHandle*>(tobj);
00092 CandStripHandleItr stripItr(recohandle->GetDaughterIterator());
00093 while (CandStripHandle *strip = stripItr()) {
00094 ceh.AddDaughterLink(*strip);
00095 }
00096 if (tobj->InheritsFrom("CandShowerHandle")) {
00097 CandShowerHandle *showerhandle = dynamic_cast<CandShowerHandle*>(tobj);
00098 ceh.AddShower(showerhandle);
00099 }
00100 if (tobj->InheritsFrom("CandTrackHandle")) {
00101 CandTrackHandle *trackhandle = dynamic_cast<CandTrackHandle*>(tobj);
00102 ceh.AddTrack(trackhandle);
00103 }
00104 }
00105
00106 ceh.SetPrimaryTrack();
00107 ceh.SetPrimaryShower(minShwEFract,shwshwdz);
00108
00109 MSG("EventSR", Msg::kVerbose)
00110 << "End Setting Primary Track and Shower" << endl;
00111
00112 CandTrackHandle * besttrack = ceh.GetPrimaryTrack();
00113 CandShowerHandle * bestshower = ceh.GetPrimaryShower();
00114
00115 // Use Boehm vertex finder - this is the default vertex for non-cosmic events
00116 VertexFinder Vfinder(&ceh,vldcptr);
00117 Int_t result = Vfinder.FindVertex();
00118
00119 if (besttrack) {
00120 ceh.SetVtxU(besttrack->GetVtxU());
00121 ceh.SetVtxV(besttrack->GetVtxV());
00122 ceh.SetVtxZ(besttrack->GetVtxZ());
00123 ceh.SetVtxT(besttrack->GetVtxT());
00124 ceh.SetVtxPlane(besttrack->GetVtxPlane());
00125 ceh.SetEndU(besttrack->GetEndU());
00126 ceh.SetEndV(besttrack->GetEndV());
00127 ceh.SetEndZ(besttrack->GetEndZ());
00128 ceh.SetEndT(besttrack->GetEndT());
00129 ceh.SetEndPlane(besttrack->GetTermPlane());
00130 ceh.SetVtxDirCosU(besttrack->GetVtxDirCosU());
00131 ceh.SetVtxDirCosV(besttrack->GetVtxDirCosV());
00132 ceh.SetVtxDirCosZ(besttrack->GetVtxDirCosZ());
00133 ceh.SetEndDirCosU(besttrack->GetEndDirCosU());
00134 ceh.SetEndDirCosV(besttrack->GetEndDirCosV());
00135 ceh.SetEndDirCosZ(besttrack->GetEndDirCosZ());
00136 }
00137 else if (bestshower) {
00138 ceh.SetVtxU(bestshower->GetVtxU());
00139 ceh.SetVtxV(bestshower->GetVtxV());
00140 ceh.SetVtxZ(bestshower->GetVtxZ());
00141 ceh.SetVtxT(bestshower->GetVtxT());
00142 ceh.SetVtxPlane(bestshower->GetVtxPlane());
00143 ceh.SetEndU(bestshower->GetEndU());
00144 ceh.SetEndV(bestshower->GetEndV());
00145 ceh.SetEndZ(bestshower->GetEndZ());
00146 ceh.SetEndT(bestshower->GetEndT());
00147 ceh.SetEndPlane(bestshower->GetTermPlane());
00148 ceh.SetVtxDirCosU(bestshower->GetVtxDirCosU());
00149 ceh.SetVtxDirCosV(bestshower->GetVtxDirCosV());
00150 ceh.SetVtxDirCosZ(bestshower->GetVtxDirCosZ());
00151 ceh.SetEndDirCosZ(bestshower->GetEndDirCosZ());
00152 ceh.SetEndDirCosU(bestshower->GetEndDirCosU());
00153 ceh.SetEndDirCosV(bestshower->GetEndDirCosV());
00154 }
00155 if(result==1 && !isCosmic){
00156 ceh.SetVtxU(Vfinder.VtxU());
00157 ceh.SetVtxV(Vfinder.VtxV());
00158 ceh.SetVtxZ(Vfinder.VtxZ());
00159 ceh.SetVtxPlane(Vfinder.VtxPlane());
00160 }
00161
00162 Calibrate(&ceh);
00163 bool contained = true;
00164 // determine whether event is contained.
00165 // set energy
00166 Float_t energy=0;
00167 if(ceh.GetPrimaryTrack()){
00168 energy+=ceh.GetPrimaryTrack()->GetMomentum();
00169 contained = ceh.GetPrimaryTrack()->IsContained();
00170 }
00171 if(ceh.GetPrimaryShower()){
00172 energy+=ceh.GetPrimaryShower()->GetEnergy();
00173 contained &= ceh.GetPrimaryShower()->IsContained();
00174 }
00175 ceh.SetEnergy(energy);
00176 ceh.SetContained(contained);
00177 }
|
|
|
Reimplemented from AlgBase. Definition at line 180 of file AlgEventSR.cxx. 00181 {
00182 }
|
1.3.9.1