00001
00002
00003
00004
00005
00006
00007
00008
00009
00011
00012 #include "Cluster3D/StripKG.h"
00013 #include "Algorithm/AlgConfig.h"
00014 #include "MessageService/MsgService.h"
00015 #include "RecoBase/CandStripHandle.h"
00016 #include "UgliGeometry/UgliGeomHandle.h"
00017
00018 ClassImp(StripKG)
00019
00020 CVSID("$Id: StripKG.cxx,v 1.2 2007/03/01 17:44:17 rhatcher Exp $");
00021
00022 StripKG::StripKG():handle(0),index(0),strip(0),plane(0),planeview(0),
00023 digit(0),tpos(0.),zpos(0.),rawE(0.),rawW(0.),
00024 siglinE(0.),siglinW(0.),sigcorE(0.),sigcorW(0.),
00025 peE(0.),peW(0.),timerawbE(0.),timerawbW(0.),timeraweE(0.),
00026 timeraweW(0.),timeE(0.),timeW(0.),timephE(0.),
00027 timephW(0.),hwidth(0.),hlength(0.),hthick(0.),clusternb(999),xtalk(false),
00028 ambig(0){
00029
00030
00031
00032 MSG("Cluster3D", Msg::kVerbose)
00033 << "Default constructor " << endl;
00034 }
00035
00036
00037 void StripKG::Print(){
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048 cout << "Content of the Strip object" << endl;
00049 cout << "index= " << index
00050 << "strip= " << strip
00051 << "plane= " << plane
00052 << "planeview= " << planeview
00053 << "digit= " << digit
00054 << endl;
00055 }
00056
00057
00058
00059 void StripKG::Set(CandStripHandle* stp, UgliGeomHandle *ugh, Int_t lp){
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077 Double_t cClear = 0.56*Munits::c_light*Munits::ns;
00078
00079 Double_t cWls = 0.73*Munits::c_light*Munits::ns;
00080
00081
00082
00083
00084 StripEnd::StripEnd_t stpend[2] = {StripEnd::kNegative,StripEnd::kPositive};
00085
00086 handle=stp;
00087 index=lp;
00088 strip=stp->GetStrip();
00089 plane=stp->GetPlane();
00090 planeview=(Int_t)(stp->GetPlaneView());
00091 digit=stp->GetNDigit();
00092 tpos=stp->GetTPos();
00093 zpos=stp->GetZPos();
00094 rawE=stp->GetCharge(CalDigitType::kNone,stpend[0]);
00095 rawW=stp->GetCharge(CalDigitType::kNone,stpend[1]);
00096 siglinE=stp->GetCharge(CalDigitType::kSigLin,stpend[0]);
00097 siglinW=stp->GetCharge(CalDigitType::kSigLin,stpend[1]);
00098 sigcorE=stp->GetCharge(CalDigitType::kSigCorr,stpend[0]);
00099 sigcorW=stp->GetCharge(CalDigitType::kSigCorr,stpend[1]);
00100 peE=stp->GetCharge(CalDigitType::kPE,stpend[0]);
00101 peW=stp->GetCharge(CalDigitType::kPE,stpend[1]);
00102 timerawbE=stp->GetBegTime(stpend[0])/Munits::ns;
00103 timerawbW=stp->GetBegTime(stpend[1])/Munits::ns;
00104 timeraweE=stp->GetEndTime(stpend[0])/Munits::ns;
00105 timeraweW=stp->GetEndTime(stpend[1])/Munits::ns;
00106
00107 PlexStripEndId stripid = stp->GetStripEndId();
00108 UgliStripHandle stph = ugh->GetStripHandle(stripid);
00109
00110 Double_t tClearE = stph.ClearFiber(stpend[0])/cClear;
00111 Double_t tWlsE = stph.WlsPigtail(stpend[0])/cWls;
00112 timeE=timerawbE-tWlsE-tClearE;
00113
00114 Double_t tClearW = stph.ClearFiber(stpend[1])/cClear;
00115 Double_t tWlsW = stph.WlsPigtail(stpend[1])/cWls;
00116 timeW=timerawbW-tWlsW-tClearW;
00117
00118 timephE=stp->GetTime(stpend[0])/Munits::ns;
00119 timephW=stp->GetTime(stpend[1])/Munits::ns;
00120
00121 hwidth=stph.GetHalfWidth();
00122 hlength=stph.GetHalfLength();
00123 hthick=stph.GetHalfThickness();
00124 }
00125
00126
00127
00128 void StripKG::TimePos(AlgConfig &ac, Bool_t oneStp, Float_t &dt, Float_t &timpos, Float_t &halflength) const{
00129
00130
00131
00132
00133
00134
00135
00136
00137
00138
00139
00140
00141
00142
00143
00144
00145
00146
00147
00148
00149
00150
00151
00152
00153
00154 const Double_t vScint = ac.GetDouble("vLightInScint");
00155 const Double_t t1t2Res = ac.GetDouble("t1-t2ResolutionInNs");
00156
00157 Double_t dtRes;
00158
00159 if(oneStp==true){
00160 dtRes = 3.*t1t2Res;
00161 }
00162 else {
00163 dtRes = t1t2Res;
00164 }
00165
00166 Float_t avStp = 96.0;
00167
00168 dt=timeE-timeW;
00169
00170 if(Timing()==2 && planeview==2 && oneStp==true){
00171 timpos=avStp-vScint*dt;
00172 halflength=dtRes*vScint;
00173 }
00174 else if(Timing()==2 && planeview==3 && oneStp==true){
00175 timpos=avStp+vScint*dt;
00176 halflength=dtRes*vScint;
00177 }
00178 else{
00179 timpos=avStp;
00180 halflength=avStp;
00181 }
00182 }
00183
00184
00185
00186 Int_t StripKG::Timing() const{
00187
00188
00189
00190
00191
00192
00193
00194
00195
00196
00197
00198
00199
00200 Int_t nbEnd;
00201 if(timeE>-1000. && timeW>-1000.){
00202 nbEnd=2;
00203 }
00204 else if(timeE>-1000. || timeW>-1000.){
00205 nbEnd=1;
00206 }
00207 else{
00208 nbEnd=0;
00209 }
00210 return nbEnd;
00211 }
00212
00213
00214
00215 Bool_t StripKG::XTalk(AlgConfig &ac){
00216
00217
00218
00219
00220
00221
00222
00223
00224
00225
00226
00227
00228
00229
00230 const Double_t peCut = ac.GetDouble("xTalkPeCut");
00231 MSG("Cluster3D", Msg::kVerbose)
00232 << "pe cut = " << peCut << endl;
00233
00234 if(digit==1 && peE<peCut && peW<peCut){
00235 xtalk=true;
00236 return true;
00237 }
00238 else{
00239 return false;
00240 xtalk=false;
00241 }
00242 }
00243
00244
00245
00246 CandStripHandle* StripKG::GetHandle() const{
00247
00248
00249
00250
00251
00252
00253
00254
00255
00256
00257
00258
00259
00260 return handle;
00261 }
00262
00263
00264