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

Public Member Functions | |
| AlgShowerSS () | |
| virtual | ~AlgShowerSS () |
| virtual void | RunAlg (AlgConfig &ac, CandHandle &ch, CandContext &cx) |
| virtual void | Trace (const char *c) const |
|
|
Definition at line 35 of file AlgShowerSS.cxx. 00036 {
00037 }
|
|
|
Definition at line 40 of file AlgShowerSS.cxx. 00041 {
00042 }
|
|
||||||||||||||||
|
Reimplemented from AlgShowerSR. Definition at line 45 of file AlgShowerSS.cxx. References CandHandle::AddDaughterLink(), CandShowerSRHandle::AddSubShower(), AlgReco::Calibrate(), CandShowerHandle::CalibrateEnergy(), CandContext::GetDataIn(), CandHandle::GetDaughterIterator(), CandRecoHandle::GetEndPlane(), CandRecoHandle::GetEndZ(), CandSubShowerSRHandle::GetEnergy(), CandStripHandle::GetPlane(), CandSubShowerSRHandle::GetPlaneView(), UgliGeomHandle::GetScintPlnHandle(), CandSubShowerSRHandle::GetSlope(), CandStripHandle::GetStripEndId(), CandStripHandle::GetTime(), CandShowerHandle::GetU(), CandShowerHandle::GetV(), CandHandle::GetVldContext(), CandRecoHandle::GetVtxPlane(), CandRecoHandle::GetVtxT(), CandRecoHandle::GetVtxU(), CandRecoHandle::GetVtxV(), CandRecoHandle::GetVtxZ(), UgliPlnHandle::GetZ0(), MSG, CandRecoHandle::SetDirCosU(), CandRecoHandle::SetDirCosV(), CandRecoHandle::SetDirCosZ(), CandRecoHandle::SetEndDirCosU(), CandRecoHandle::SetEndDirCosV(), CandRecoHandle::SetEndDirCosZ(), CandRecoHandle::SetEndPlane(), CandRecoHandle::SetEndT(), CandRecoHandle::SetEndU(), CandRecoHandle::SetEndV(), CandRecoHandle::SetEndZ(), CandShowerHandle::SetEnergy(), AlgShowerSR::SetUV(), CandRecoHandle::SetVtxPlane(), CandRecoHandle::SetVtxT(), CandRecoHandle::SetVtxU(), CandRecoHandle::SetVtxV(), and CandRecoHandle::SetVtxZ(). 00046 {
00047
00048 MSG("ShowerSS",Msg::kDebug) << "In AlgShowerSS::RunAlg" << endl;
00049 assert(ch.InheritsFrom("CandShowerSRHandle"));
00050 CandShowerSRHandle &csh = dynamic_cast<CandShowerSRHandle &>(ch);
00051
00052 assert(cx.GetDataIn());
00053 assert(cx.GetDataIn()->InheritsFrom("TObjArray"));
00054
00055 // grab parameters
00056 //Double_t MIPperGeV = ac.GetDouble("MIPperGeV");
00057
00058 Double_t tend = 0;
00059 Double_t totEnergy = 0;
00060 Double_t maxUEnergy = 0;
00061 Double_t maxVEnergy = 0;
00062 Double_t earlyUZ = 100.;
00063 Double_t earlyVZ = 100.;
00064 Double_t earlyUend = 100.;
00065 Double_t earlyVend = 100.;
00066 Int_t earlyUPln = 500;
00067 Int_t earlyVPln = 500;
00068 Double_t earlyUPh = 0.;
00069 Double_t earlyVPh = 0.;
00070 Int_t biggestUSubShower = -1;
00071 Int_t biggestVSubShower = -1;
00072 CandStripHandle *begstrip = 0;
00073 CandStripHandle *endstrip = 0;
00074
00075 const TObjArray *tary = dynamic_cast<const TObjArray*>(cx.GetDataIn());
00076 MSG("AlgShowerSS",Msg::kDebug) << "Passed " << tary->GetLast()+1
00077 << " SubShowerSRHandles" << endl;
00078
00079 for (Int_t i=0; i<=tary->GetLast(); i++) {
00080 TObject *tobj = tary->At(i);
00081 assert(tobj->InheritsFrom("CandSubShowerSRHandle"));
00082 CandSubShowerSRHandle *subshowerhandle =
00083 dynamic_cast<CandSubShowerSRHandle*>(tobj);
00084 csh.AddSubShower(subshowerhandle);
00085 totEnergy += subshowerhandle->GetEnergy();
00086
00087 MSG("AlgShowerSS",Msg::kDebug) << "Current energy " << totEnergy << endl;
00088 switch (subshowerhandle->GetPlaneView()) {
00089 case PlaneView::kU :
00090 MSG("AlgShowerSS",Msg::kDebug) << "U SubShower found" << endl;
00091 if(subshowerhandle->GetEnergy()>maxUEnergy){
00092 maxUEnergy = subshowerhandle->GetEnergy();
00093 biggestUSubShower = i;
00094 }
00095 if(subshowerhandle->GetVtxZ()<earlyUZ){
00096 earlyUZ = subshowerhandle->GetVtxZ();
00097 earlyUend = subshowerhandle->GetEndZ();
00098 earlyUPln = subshowerhandle->GetVtxPlane();
00099 earlyUPh = subshowerhandle->GetEnergy();
00100 MSG("AlgShowerSS",Msg::kDebug) <<"early U "<<earlyUZ
00101 <<" end "<<earlyUend
00102 <<" ph "<<earlyUPh<<endl;
00103 }
00104 break;
00105 case PlaneView::kV :
00106 MSG("AlgShowerSS",Msg::kDebug) << "V SubShower found" << endl;
00107 if(subshowerhandle->GetEnergy()>maxVEnergy){
00108 maxVEnergy = subshowerhandle->GetEnergy();
00109 biggestVSubShower = i;
00110 }
00111 if(subshowerhandle->GetVtxZ()<earlyVZ){
00112 earlyVZ = subshowerhandle->GetVtxZ();
00113 earlyVend = subshowerhandle->GetEndZ();
00114 earlyVPln = subshowerhandle->GetVtxPlane();
00115 earlyVPh = subshowerhandle->GetEnergy();
00116 MSG("AlgShowerSS",Msg::kDebug) <<"early V "<<earlyVZ
00117 <<" end "<<earlyVend
00118 <<" ph "<<earlyVPh<<endl;
00119 }
00120 break;
00121 default:
00122 break;
00123 }
00124
00125 CandStripHandleItr stripItr(subshowerhandle->GetDaughterIterator());
00126 while (CandStripHandle *strip = stripItr()) {
00127 csh.AddDaughterLink(*strip);
00128 if(strip->GetTime()>tend) tend = strip->GetTime();
00129 if (!begstrip || strip->GetPlane()<begstrip->GetPlane()) {
00130 begstrip = strip;
00131 }
00132 if (!endstrip || strip->GetPlane()>endstrip->GetPlane()) {
00133 endstrip = strip;
00134 }
00135 }
00136 }
00137
00138 //bail if there is no subshower in either view
00139 if(biggestUSubShower==-1||biggestVSubShower==-1){
00140 MSG("AlgShowerSS", Msg::kInfo)
00141 << "Insufficient SubShowerSR objects to form CandShowerSR"
00142 << endl;
00143 csh.SetDirCosU(0.);
00144 csh.SetDirCosV(0.);
00145 csh.SetDirCosZ(1.);
00146 csh.SetVtxPlane(-1);
00147 csh.SetVtxZ(-1.);
00148 csh.SetVtxU(0.);
00149 csh.SetVtxV(0.);
00150 csh.SetVtxT(0.);
00151 csh.SetEndZ(-1.);
00152 csh.SetEndU(0.);
00153 csh.SetEndV(0.);
00154 csh.SetEndT(0.);
00155 csh.SetEnergy(0);
00156 return;
00157 }
00158
00159
00160 TObject *Uobj = tary->At(biggestUSubShower);
00161 CandSubShowerSRHandle *bigUss = dynamic_cast<CandSubShowerSRHandle*>(Uobj);
00162 float dudz = bigUss->GetSlope();
00163
00164 TObject *Vobj = tary->At(biggestVSubShower);
00165 CandSubShowerSRHandle *bigVss = dynamic_cast<CandSubShowerSRHandle*>(Vobj);
00166 float dvdz = bigVss->GetSlope();
00167
00168 float dsdz = TMath::Sqrt(1 + dudz*dudz + dvdz*dvdz);
00169 csh.SetDirCosU(dudz/dsdz);
00170 csh.SetDirCosV(dvdz/dsdz);
00171 csh.SetDirCosZ(1./dsdz);
00172
00173 csh.SetEndDirCosU(dudz/dsdz);
00174 csh.SetEndDirCosV(dvdz/dsdz);
00175 csh.SetEndDirCosZ(1./dsdz);
00176
00177 csh.SetVtxU(bigUss->GetVtxU());
00178 csh.SetVtxV(bigVss->GetVtxV());
00179
00180 const VldContext *vc = begstrip->GetVldContext();
00181 UgliGeomHandle ugh(*vc);
00182 PlexStripEndId stripid = begstrip->GetStripEndId();
00183 UgliScintPlnHandle planehandle = ugh.GetScintPlnHandle(stripid);
00184
00185 stripid = endstrip->GetStripEndId();
00186 planehandle = ugh.GetScintPlnHandle(stripid);
00187 csh.SetEndPlane(endstrip->GetPlane());
00188 csh.SetEndZ(planehandle.GetZ0());
00189
00190 csh.SetVtxZ(bigUss->GetVtxZ());
00191 csh.SetVtxPlane(bigUss->GetVtxPlane());
00192 if(bigUss->GetVtxZ()>bigVss->GetVtxZ()) {
00193 csh.SetVtxZ(bigVss->GetVtxZ());
00194 csh.SetVtxPlane(bigVss->GetVtxPlane());
00195 }
00196
00197 MSG("AlgShowerSS",Msg::kDebug) <<"big U Z "<<bigUss->GetVtxZ()
00198 <<" maxUEnergy "<<maxUEnergy
00199 <<" maxVEnergy "<<maxVEnergy
00200 <<" big V Z "<<bigVss->GetVtxZ()
00201 <<" early U "<<earlyUZ<<" end "
00202 <<earlyUend<<" ph "<<earlyUPh
00203 <<" early V "<<earlyVZ<<" end "
00204 <<earlyVend<<" ph "<<earlyVPh<<endl;
00205
00206 //check if another high-ish energy U view subshower
00207 //gives an earlier (but reasonable) Z vertex
00208 Double_t difUZ = csh.GetVtxZ()-earlyUZ;
00209 if(earlyUPh > 0.1*maxUEnergy && difUZ>0. &&
00210 (difUZ<0.25 || (difUZ>0.25 && difUZ<0.5 &&
00211 bigUss->GetVtxZ() < earlyUend+0.15) ) ) {
00212 csh.SetVtxZ(earlyUZ);
00213 csh.SetVtxPlane(earlyUPln);
00214 }
00215 else difUZ = 0; //difUZ is invalid: disregard difVZ>difUZ when checking V
00216
00217 //check if another high-ish energy V view subshower
00218 //gives an earlier (but reasonable) Z vertex
00219 //also check that V view Z vertex is earlier than U view vertex
00220 //before changing shower vertex
00221 Double_t difVZ = csh.GetVtxZ()-earlyVZ;
00222 if(earlyVPh>0.1*maxVEnergy && difVZ>0. && difVZ>difUZ &&
00223 (difVZ<0.25 || (difUZ>0.25 && difUZ<0.5 &&
00224 bigVss->GetVtxZ() < earlyVend+0.15 ) ) ){
00225 csh.SetVtxZ(earlyVZ);
00226 csh.SetVtxPlane(earlyVPln);
00227 }
00228
00229 Double_t tvtx = bigUss->GetVtxT();
00230 if(bigVss->GetVtxT()<tvtx) tvtx = bigVss->GetVtxT();
00231 csh.SetVtxT(tvtx);
00232 csh.SetEndT(tend);
00233
00234 SetUV(&csh);
00235
00236 csh.SetEndU(csh.GetU(csh.GetEndPlane()));
00237 csh.SetEndV(csh.GetV(csh.GetEndPlane()));
00238
00239 Calibrate(&csh);
00240
00241 //csh.SetEnergy(totEnergy);
00242 //csh.SetEnergy(csh.GetCharge(CalStripType::kGeV));
00243 CandTrackHandle * associatedtrk=0;
00244 csh.CalibrateEnergy(associatedtrk,ac);
00245 }
|
|
|
Reimplemented from AlgShowerSR. Definition at line 248 of file AlgShowerSS.cxx. 00249 {
00250 }
|
1.3.9.1