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

Protected Member Functions | |
| void | Calibrate (CandRecoHandle *) |
| AlgReco () | |
| virtual | ~AlgReco () |
Definition at line 20 of file AlgReco.h.
| virtual AlgReco::~AlgReco | ( | ) | [inline, protected, virtual] |
| void AlgReco::Calibrate | ( | CandRecoHandle * | ) | [protected] |
Definition at line 39 of file AlgReco.cxx.
References Calibrator::GetAttenCorrectedTpos(), PlexStripEndId::GetEncoded(), CandEventHandle::GetLastShower(), CandEventHandle::GetLastTrack(), Calibrator::GetMIP(), CandEventHandle::GetShower(), CandEventHandle::GetTrack(), CandTrackHandle::GetTrackPointError(), CandTrackHandle::GetU(), CandTrackHandle::GetV(), CandRecoHandle::GetVtxU(), Calibrator::Instance(), Msg::kDebug, StripEnd::kNegative, StripEnd::kPositive, CalDigitType::kSigCorr, PlaneView::kU, PlaneView::kV, PlaneView::kX, PlaneView::kY, Munits::meter, MSG, and ValueErr< T >::SetError().
Referenced by AlgFitTrackMS::InitFitHandle(), AlgTrackSR::RunAlg(), AlgTrackCam::RunAlg(), AlgShowerSS::RunAlg(), AlgShowerSR::RunAlg(), AlgShowerEM::RunAlg(), AlgFitTrackSR::RunAlg(), AlgEventSR::RunAlg(), AlgFitTrackCam::SetPropertiesFromFinderTrack(), and AlgFitTrackCam::SetTrackProperties().
00040 { 00041 Calibrator& cal = Calibrator::Instance(); 00042 00043 Bool_t isEvent = candreco->InheritsFrom("CandEventHandle"); 00044 const CandEventHandle *candevent = 0; 00045 if (isEvent) { 00046 00047 candevent = dynamic_cast<const CandEventHandle*>(candreco); 00048 for(Int_t i=0;i<=candevent->GetLastShower();i++){ 00049 00050 const CandShowerHandle *candshower = candevent->GetShower(i); 00051 TIter stripItr(candshower->GetDaughterIterator()); 00052 while (CandStripHandle *strip = dynamic_cast<CandStripHandle*>(stripItr())) { 00053 FloatErr tpos=0.; 00054 int plane = strip->GetPlane(); 00055 switch (strip->GetPlaneView()) { 00056 case PlaneView::kX: case PlaneView::kU: 00057 tpos = candshower->GetV(plane); 00058 tpos.SetError(1.0 * Munits::meter); // Since this next call doesn't work: 00059 //tpos.SetError( 0.5 * (candshower->GetMaxV(plane) - candshower->GetMinV(plane)) ); 00060 break; 00061 case PlaneView::kY: case PlaneView::kV: 00062 tpos = candshower->GetU(plane); 00063 tpos.SetError(1.0 * Munits::meter); // Since this next call doesn't work: 00064 //tpos.SetError( 0.5 * (candshower->GetMaxU(plane) - candshower->GetMinU(plane)) ); 00065 break; 00066 default: 00067 continue; 00068 } 00069 00070 if (fabs(tpos)>4.) { 00071 MSG("RecoBase",Msg::kDebug) << "tpos = " << tpos << " outside detector" << endl; 00072 if (tpos>0.) { 00073 tpos = 4.; 00074 } else { 00075 tpos = -4.; 00076 } 00077 } 00078 00079 FloatErr sigcorr; 00080 FloatErr sigmap, sigmip; 00081 PlexStripEndId seid; 00082 if (strip->GetNDigit(StripEnd::kNegative)>0) { 00083 seid = strip->GetStripEndId(StripEnd::kNegative); 00084 sigcorr = strip->GetCharge(StripEnd::kNegative,CalDigitType::kSigCorr); 00085 sigmap = cal.GetAttenCorrectedTpos(sigcorr, tpos, seid); 00086 sigmip = cal.GetMIP (sigmap, seid); 00087 00088 candreco->CalibrateSigMapped(seid.GetEncoded(),sigmap); 00089 candreco->CalibrateMIP (seid.GetEncoded(),sigmip); 00090 } 00091 if (strip->GetNDigit(StripEnd::kPositive)>0) { 00092 seid = strip->GetStripEndId(StripEnd::kPositive); 00093 sigcorr = strip->GetCharge(StripEnd::kPositive,CalDigitType::kSigCorr); 00094 sigmap = cal.GetAttenCorrectedTpos(sigcorr, tpos, seid); 00095 sigmip = cal.GetMIP (sigmap, seid); 00096 00097 00098 candreco->CalibrateSigMapped(seid.GetEncoded(),sigmap); 00099 candreco->CalibrateMIP (seid.GetEncoded(),sigmip); 00100 } 00101 } 00102 } 00103 for(Int_t i=0;i<=candevent->GetLastTrack();i++){ 00104 const CandTrackHandle *candtrack = candevent->GetTrack(i); 00105 00106 TIter stripItr(candtrack->GetDaughterIterator()); 00107 while (CandStripHandle *strip = dynamic_cast<CandStripHandle*>(stripItr())) { 00108 FloatErr tpos=0.; 00109 switch (strip->GetPlaneView()) { 00110 case PlaneView::kX: case PlaneView::kU: 00111 tpos = candtrack->GetV(strip->GetPlane()); 00112 tpos.SetError(candtrack->GetTrackPointError(strip->GetPlane())); // Set error on tpos. 00113 break; 00114 case PlaneView::kY: case PlaneView::kV: 00115 tpos = candtrack->GetU(strip->GetPlane()); 00116 tpos.SetError(candtrack->GetTrackPointError(strip->GetPlane())); // Set error on tpos. 00117 break; 00118 default: 00119 continue; 00120 } 00121 00122 if (fabs(tpos)>4.) { 00123 MSG("RecoBase",Msg::kDebug) << "tpos = " << tpos << " outside detector" << endl; 00124 if (tpos>0.) { 00125 tpos = 4.; 00126 } else { 00127 tpos = -4.; 00128 } 00129 } 00130 00131 FloatErr sigcorr; 00132 FloatErr sigmap, sigmip; 00133 PlexStripEndId seid; 00134 if (strip->GetNDigit(StripEnd::kNegative)>0) { 00135 seid = strip->GetStripEndId(StripEnd::kNegative); 00136 sigcorr = strip->GetCharge(StripEnd::kNegative,CalDigitType::kSigCorr); 00137 sigmap = cal.GetAttenCorrectedTpos(sigcorr, tpos, seid); 00138 sigmip = cal.GetMIP( sigmap, seid); 00139 00140 candreco->CalibrateSigMapped(seid.GetEncoded(),sigmap); 00141 candreco->CalibrateMIP (seid.GetEncoded(),sigmip); 00142 00143 } 00144 if (strip->GetNDigit(StripEnd::kPositive)>0) { 00145 seid = strip->GetStripEndId(StripEnd::kPositive); 00146 sigcorr = strip->GetCharge(StripEnd::kPositive,CalDigitType::kSigCorr); 00147 sigmap = cal.GetAttenCorrectedTpos(sigcorr, tpos, seid); 00148 sigmip = cal.GetMIP (sigmap, seid); 00149 candreco->CalibrateSigMapped(seid.GetEncoded(),sigmap); 00150 candreco->CalibrateMIP (seid.GetEncoded(),sigmip); 00151 } 00152 } 00153 } 00154 } 00155 00156 else{ 00157 TIter stripItr(candreco->GetDaughterIterator()); 00158 Bool_t isTrack = candreco->InheritsFrom("CandTrackHandle"); 00159 const CandTrackHandle *candtrack = 0; 00160 if (isTrack) { 00161 candtrack = dynamic_cast<const CandTrackHandle*>(candreco); 00162 } 00163 Bool_t isShower = candreco->InheritsFrom("CandShowerHandle"); 00164 const CandShowerHandle *candshower = 0; 00165 if (isShower) { 00166 candshower = dynamic_cast<const CandShowerHandle*>(candreco); 00167 } 00168 Double_t vtxuvpos[2] = {candreco->GetVtxU(),candreco->GetVtxV()}; 00169 while (CandStripHandle *strip = dynamic_cast<CandStripHandle*>(stripItr())) { 00170 Int_t iview=-1; 00171 switch (strip->GetPlaneView()) { 00172 case PlaneView::kX: case PlaneView::kU: 00173 iview = 1; 00174 break; 00175 case PlaneView::kY: case PlaneView::kV: 00176 iview = 0; 00177 break; 00178 default: 00179 continue; 00180 } 00181 FloatErr tpos = 0.; 00182 int plane = strip->GetPlane(); 00183 // get position of hit along strip from orthogonal view info. 00184 if(candtrack){ 00185 if (!iview) { 00186 tpos = candtrack->GetU(plane); 00187 tpos.SetError(candtrack->GetTrackPointError(plane)); // Set error on tpos. 00188 } 00189 else { 00190 tpos = candtrack->GetV(plane); 00191 tpos.SetError(candtrack->GetTrackPointError(plane)); // Set error on tpos. 00192 } 00193 } 00194 else if (candshower){ 00195 if (!iview) { 00196 tpos = candshower->GetU(plane); 00197 tpos.SetError(1.0*Munits::meter); // Since this other call doesn't work: 00198 //tpos.SetError( 0.5 * (candshower->GetMaxU(plane) - candshower->GetMinU(plane)) ); 00199 } 00200 else { 00201 tpos = candshower->GetV(plane); 00202 tpos.SetError(1.0*Munits::meter); // Since this other call doesn't work: 00203 //tpos.SetError( 0.5 * (candshower->GetMaxV(plane) - candshower->GetMinV(plane)) ); 00204 } 00205 } 00206 else { 00207 tpos = vtxuvpos[iview]; 00208 } 00209 00210 if (fabs(tpos)>4.) { 00211 MSG("RecoBase",Msg::kDebug) << "tpos = " << tpos << " outside detector" << endl; 00212 if (tpos>0.) { 00213 tpos = 4.; 00214 } else { 00215 tpos = -4.; 00216 } 00217 } 00218 00219 00220 FloatErr sigcorr; 00221 FloatErr sigmap, sigmip; 00222 PlexStripEndId seid; 00223 if (strip->GetNDigit(StripEnd::kNegative)>0) { 00224 seid = strip->GetStripEndId(StripEnd::kNegative); 00225 sigcorr = strip->GetCharge(StripEnd::kNegative,CalDigitType::kSigCorr); 00226 sigmap = cal.GetAttenCorrectedTpos(sigcorr, tpos, seid); 00227 sigmip = cal.GetMIP( sigmap, seid); 00228 00229 candreco->CalibrateSigMapped(seid.GetEncoded(),sigmap); 00230 candreco->CalibrateMIP (seid.GetEncoded(),sigmip); 00231 } 00232 if (strip->GetNDigit(StripEnd::kPositive)>0) { 00233 seid = strip->GetStripEndId(StripEnd::kPositive); 00234 sigcorr = strip->GetCharge(StripEnd::kPositive,CalDigitType::kSigCorr); 00235 sigmap = cal.GetAttenCorrectedTpos(sigcorr, tpos, seid); 00236 sigmip = cal.GetMIP (sigmap, seid); 00237 00238 candreco->CalibrateSigMapped(seid.GetEncoded(),sigmap); 00239 candreco->CalibrateMIP (seid.GetEncoded(),sigmip); 00240 } 00241 } 00242 } 00243 }
1.4.7