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

StripKG.cxx

Go to the documentation of this file.
00001 
00002 // Cluster3D package
00003 //
00004 // StripKG.cxx
00005 //
00006 // StripKG - a strip
00007 //
00008 // Author:  Katarzyna Grzelak K.Grzelak1@physics.ox.ac.uk
00009 //
00011 
00012 #include "Cluster3D/StripKG.h"
00013 #include "Algorithm/AlgConfig.h"
00014 #include "MessageService/MsgService.h" // needed for CVS
00015 #include "RecoBase/CandStripHandle.h"     
00016 #include "UgliGeometry/UgliGeomHandle.h"   // UgliGeom handling
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 //  Purpose:  Default constructor
00031 //
00032   MSG("Cluster3D", Msg::kVerbose)
00033     << "Default constructor " << endl;
00034 }
00035 //............................................................................
00036 
00037 void StripKG::Print(){
00038 //
00039 //  Purpose:  Prints contents of the strip object.
00040 //
00041 //  Arguments: n/a
00042 //
00043 //  Return:  n/a
00044 //
00045 //  Contact:   K.Grzelak1@physics.ox.ac.uk
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 //  Purpose: Set StripKG data members 
00062 //
00063 //  Arguments: 
00064 //           stp   in  - strip handle   
00065 //           ugh   in  - UgliGeom handle
00066 //            lp   in  - serial strip number
00067 //              
00068 //  Return:  n/a
00069 //
00070 //  Contact:   K.Grzelak1@physics.ox.ac.uk
00071 //
00072 //
00073 //  Program Notes:-
00074 //  =============
00075 
00076   // Light propagation velocity in a clear fiber in m/ns
00077   Double_t cClear = 0.56*Munits::c_light*Munits::ns; 
00078   // Light propagation velocity in a Wls  fiber in m/ns
00079   Double_t cWls = 0.73*Munits::c_light*Munits::ns; 
00080   // Light propagation velocity in a scintillator in m/ns
00081   //Double_t cScint = 0.56*Munits::c_light*Munits::ns; 
00082 
00083   // Two ends of strip
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 //  Purpose:  Return hit position from timing information.
00131 //
00132 //  Arguments: 
00133 //           ac           in  -  AlgConfig 
00134 //           oneStp       in  -  true = one hit per plane => use timing info
00135 //                               false = more than one hit => do not use timing
00136 //           dt          out  -  time difference [ns] 
00137 //           timpos      out  -  position from time [strips]
00138 //           halflength  out  -  half of the length of the cell [strips]
00139 //              
00140 //  Return:  n/a
00141 //
00142 //  Contact:   K.Grzelak1@physics.ox.ac.uk
00143 //
00144 //
00145 //  Program Notes:-
00146 //  =============
00147 //
00148 // Fit results: mean strip & velocity in the scintillator in strips/ns
00149 // avStp = mean strip/length of half of the strip in strips
00150 // vScint/2 = velocity in the scintillator [strip/ns]
00151 // dtRes = time resolution [ns] 
00152 // widthStp = strip width [m]
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 //  Purpose:  Return 
00189 //
00190 //  Arguments: 
00191 //              
00192 //  Return:  n/a
00193 //
00194 //  Contact:   K.Grzelak1@physics.ox.ac.uk
00195 //
00196 //
00197 //  Program Notes:-
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 //  Purpose:  Is it a crosstalk hit ?
00218 //
00219 //  Arguments: 
00220 //           ac         in  -  AlgConfig
00221 //              
00222 //  Return:  Bool_t crosstalk hit or not ?
00223 //
00224 //  Contact:   K.Grzelak1@physics.ox.ac.uk
00225 //
00226 //
00227 //  Program Notes:-
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 //  Purpose:  return handle to a strip
00249 //
00250 //  Arguments: n/a
00251 //              
00252 //  Return:  CandStripHandle* handle 
00253 //
00254 //  Contact:   K.Grzelak1@physics.ox.ac.uk
00255 //
00256 //
00257 //  Program Notes:-
00258 //  =============
00259   
00260   return handle;
00261 }
00262 
00263 //............................................................................
00264 

Generated on Mon Feb 15 11:07:40 2010 for loon by  doxygen 1.3.9.1