AlgFarDetStrip Class Reference

#include <AlgFarDetStrip.h>

Inheritance diagram for AlgFarDetStrip:
AlgBase

List of all members.

Public Member Functions

 AlgFarDetStrip ()
virtual ~AlgFarDetStrip ()
virtual void RunAlg (AlgConfig &ac, CandHandle &ch, CandContext &cx)
virtual void Trace (const char *c) const

Detailed Description

Definition at line 7 of file AlgFarDetStrip.h.


Constructor & Destructor Documentation

AlgFarDetStrip::AlgFarDetStrip (  ) 

Definition at line 29 of file AlgFarDetStrip.cxx.

References Msg::kVerbose, and MSG.

00030 {
00031   MSG("FarDetStrip",Msg::kVerbose) << " AlgFarDetStrip::AlgFarDetStrip() " << endl;
00032   
00033 }   

AlgFarDetStrip::~AlgFarDetStrip (  )  [virtual]

Definition at line 35 of file AlgFarDetStrip.cxx.

References Msg::kVerbose, and MSG.

00036 {
00037   MSG("FarDetStrip",Msg::kVerbose) << " AlgFarDetStrip::~AlgFarDetStrip() " << endl;
00038   
00039 }


Member Function Documentation

void AlgFarDetStrip::RunAlg ( AlgConfig ac,
CandHandle ch,
CandContext cx 
) [virtual]

Implements AlgBase.

Definition at line 41 of file AlgFarDetStrip.cxx.

References CandHandle::AddDaughterLink(), UgliStripHandle::ClearFiber(), digit(), PlexSEIdAltL::GetBestSEId(), VaDigit::GetCandDigitHandle(), CandContext::GetCandRecord(), CandDigitHandle::GetCharge(), FarDetStripHandle::GetCharge(), VaDigit::GetChargeAdc(), VaDigit::GetCrossTalkChargeAdc(), CandContext::GetDataIn(), CandDeMuxDigitHandle::GetDeMuxDigitFlagWord(), PlexStripEndId::GetEnd(), UgliStripHandle::GetHalfLength(), CandHandle::GetNDaughters(), PlexPlaneId::GetPlane(), FarDetStripHandle::GetPlane(), CandDigitHandle::GetPlexSEIdAltL(), UgliGeomHandle::GetScintPlnHandle(), FarDetStripHandle::GetStrip(), PlexStripEndId::GetStrip(), UgliGeomHandle::GetStripHandle(), CandDigitHandle::GetSubtractedTime(), FarDetStripHandle::GetTime(), UgliStripHandle::GetTPos(), RecMinos::GetVldContext(), UgliPlnHandle::GetZ0(), Msg::kDebug, StripEnd::kNegative, CalTimeType::kNone, CalDigitType::kNone, CalDigitType::kPE, StripEnd::kPositive, CalDigitType::kSigCorr, CalDigitType::kSigLin, CalTimeType::kT0, Msg::kVerbose, CandDeMuxDigit::kXTalk, MSG, CandStripHandle::SetBestStripEndId(), CandStripHandle::SetCalTimeType(), FarDetStripHandle::SetCharge(), FarDetStripHandle::SetFibreLengths(), FarDetStripHandle::SetPlane(), FarDetStripHandle::SetStrip(), FarDetStripHandle::SetTime(), CandStripHandle::SetTPos(), FarDetStripHandle::SetXtalk(), CandStripHandle::SetZPos(), and UgliStripHandle::WlsPigtail().

00043 {
00044   MSG("FarDetStrip",Msg::kVerbose) << " AlgFarDetStrip::RunAlg(...) " << endl;
00045 
00046   FarDetStripHandle& mystrip = dynamic_cast<FarDetStripHandle&>(ch);
00047 
00048   Double_t corr=1.0;
00049   Int_t i;
00050 
00051   const TObjArray* myarray = dynamic_cast<const TObjArray*>(cx.GetDataIn());
00052   CandRecord* candrec = (CandRecord*)(cx.GetCandRecord());
00053   VldContext* vldc = (VldContext*)(candrec->GetVldContext());
00054   UgliGeomHandle ugh(*vldc);
00055   PlexHandle ph(*vldc);
00056 
00057   Int_t myXtalk[3];
00058   Double_t myRawTime[3];
00059   Double_t myCalTime[3];
00060   Double_t myChargeNone[2];
00061   Double_t myChargeAdc[2];
00062   Double_t myChargePE[2];
00063   Double_t myChargeSigLin[2];
00064   Double_t myChargeSigCorr[2];
00065   Double_t myChargePEcorr[2];
00066   Double_t myGreenFibre[2];
00067   Double_t myWlsPigtail[2];
00068   Double_t myClearFibre[2];
00069   Double_t myHalfLength;
00070 
00071   for(i=0;i<3;i++){
00072     myRawTime[i] = 0.0;
00073     myCalTime[i] = 0.0;
00074     myXtalk[i] = 0;
00075   }
00076 
00077   for(i=0;i<2;i++){
00078     myChargeNone[i] = 0.0;
00079     myChargeAdc[i] = 0.0;
00080     myChargePE[i] = 0.0;
00081     myChargeSigLin[i] = 0.0;
00082     myChargeSigCorr[i] = 0.0;
00083     myChargePEcorr[i] = 0.0;
00084     myGreenFibre[i] = 0.0;
00085     myWlsPigtail[i] = 0.0;
00086     myClearFibre[i] = 0.0;
00087   }
00088 
00089   myHalfLength = 0.0;
00090 
00091  
00092   for(i=0;i<1+myarray->GetLast();i++){
00093     VaDigit* vadigit = (VaDigit*)(myarray->At(i));
00094     corr = (vadigit->GetChargeAdc()+vadigit->GetCrossTalkChargeAdc())/(vadigit->GetChargeAdc());
00095 
00096     CandDigitHandle* digit = (CandDigitHandle*)(vadigit->GetCandDigitHandle());
00097     PlexStripEndId pSEId = digit->GetPlexSEIdAltL().GetBestSEId();
00098 
00099     if(!i){
00100       mystrip.SetBestStripEndId(pSEId);  
00101       UgliStripHandle striphandle = ugh.GetStripHandle(pSEId);
00102       UgliScintPlnHandle scintplnhandle = ugh.GetScintPlnHandle(pSEId);
00103 
00104       myGreenFibre[0] = striphandle.GetHalfLength();
00105       myWlsPigtail[0] = striphandle.WlsPigtail(StripEnd::kNegative);
00106       myClearFibre[0] = striphandle.ClearFiber(StripEnd::kNegative);
00107 
00108       myGreenFibre[1] = striphandle.GetHalfLength();
00109       myWlsPigtail[1] = striphandle.WlsPigtail(StripEnd::kPositive);
00110       myClearFibre[1] = striphandle.ClearFiber(StripEnd::kPositive);
00111 
00112       myHalfLength = striphandle.GetHalfLength();
00113 
00114       mystrip.SetPlane(pSEId.GetPlane());
00115       mystrip.SetStrip(pSEId.GetStrip());
00116       mystrip.SetTPos(striphandle.GetTPos());
00117       mystrip.SetZPos(scintplnhandle.GetZ0());
00118     }
00119 
00120     if(pSEId.GetEnd()==StripEnd::kNegative){
00121       CandDeMuxDigitHandle* demuxdigit = (CandDeMuxDigitHandle*)(digit);
00122       if( (demuxdigit->GetDeMuxDigitFlagWord()<8)
00123        && ( (demuxdigit->GetDeMuxDigitFlagWord() & CandDeMuxDigit::kXTalk)==(CandDeMuxDigit::kXTalk) ) ){
00124         myXtalk[0]=1; myXtalk[2]=1;
00125       }
00126       myRawTime[0] = digit->GetSubtractedTime(CalTimeType::kNone);
00127       myCalTime[0] = digit->GetSubtractedTime(CalTimeType::kT0);
00128       myChargeNone[0] = digit->GetCharge(CalDigitType::kNone);
00129       myChargeAdc[0] = corr*(digit->GetCharge(CalDigitType::kNone));
00130       myChargePE[0] = corr*(digit->GetCharge(CalDigitType::kPE));
00131       myChargeSigLin[0] = corr*(digit->GetCharge(CalDigitType::kSigLin));
00132       myChargeSigCorr[0] = corr*(digit->GetCharge(CalDigitType::kSigCorr));
00133       myChargePEcorr[0] = myChargeSigCorr[0]/67.5;
00134       
00135       MSG("FarDetStrip",Msg::kVerbose) << " -ve : " 
00136                                        << " Qraw=" << myChargeNone[0] 
00137                                        << " Qadc=" << myChargeAdc[0]
00138                                        << " Qpe=" << myChargePE[0]
00139                                        << " QpeCorr=" << myChargePEcorr[0] << endl;
00140     }
00141 
00142     if(pSEId.GetEnd()==StripEnd::kPositive){
00143       CandDeMuxDigitHandle* demuxdigit = (CandDeMuxDigitHandle*)(digit);
00144       if( (demuxdigit->GetDeMuxDigitFlagWord()<8)
00145        && ( (demuxdigit->GetDeMuxDigitFlagWord() & CandDeMuxDigit::kXTalk)==(CandDeMuxDigit::kXTalk) ) ){
00146         myXtalk[1]=1; myXtalk[2]=1;
00147       }
00148       myRawTime[1] = digit->GetSubtractedTime(CalTimeType::kNone);
00149       myCalTime[1] = digit->GetSubtractedTime(CalTimeType::kT0);
00150       myChargeNone[1] = digit->GetCharge(CalDigitType::kNone);
00151       myChargeAdc[1] = corr*(digit->GetCharge(CalDigitType::kNone));
00152       myChargePE[1] = corr*(digit->GetCharge(CalDigitType::kPE));
00153       myChargeSigLin[1] = corr*(digit->GetCharge(CalDigitType::kSigLin));
00154       myChargeSigCorr[1] = corr*(digit->GetCharge(CalDigitType::kSigCorr));
00155       myChargePEcorr[1] = myChargeSigCorr[1]/67.5;
00156       
00157       MSG("FarDetStrip",Msg::kVerbose) << " +ve : " 
00158                                        << " Qraw=" << myChargeNone[1] 
00159                                        << " Qadc=" << myChargeAdc[1]
00160                                        << " Qpe=" << myChargePE[1]
00161                                        << " QpeCorr=" << myChargePEcorr[1] << endl;
00162                                           
00163     }
00164     
00165     mystrip.AddDaughterLink(*digit);
00166   }
00167 
00168   Double_t Sqrt=0.0,Sqct=0.0,Sq=0.0;
00169   for(i=0;i<2;i++){
00170     Sqrt+=myRawTime[i]*myChargePE[i];
00171     Sqct+=myCalTime[i]*myChargePE[i]; 
00172     Sq+=myChargePE[i];
00173   }
00174   if(Sq>0.0){
00175     myRawTime[2] = Sqrt/Sq;
00176     myCalTime[2] = Sqct/Sq;
00177   }
00178 
00179   mystrip.SetTime(CalTimeType::kNone,myRawTime);
00180   mystrip.SetTime(CalTimeType::kT0,myCalTime);
00181   mystrip.SetCalTimeType(CalTimeType::kT0);
00182 
00183   mystrip.SetCharge(CalDigitType::kNone,myChargeAdc);
00184   mystrip.SetCharge(CalDigitType::kPE,myChargePE);
00185   mystrip.SetCharge(CalDigitType::kSigLin,myChargeSigLin);
00186   mystrip.SetCharge(CalDigitType::kSigCorr,myChargeSigCorr);
00187 
00188   mystrip.SetFibreLengths(myGreenFibre,myWlsPigtail,myClearFibre,myHalfLength);
00189   mystrip.SetXtalk(myXtalk);
00190 
00191   MSG("FarDetStrip",Msg::kDebug) << "  CANDSTRIP : "
00192                                  << " (" << mystrip.GetNDaughters() << ")"
00193                                  << " " << mystrip.GetPlane()
00194                                  << " " << mystrip.GetStrip() 
00195                                  << " " << mystrip.GetCharge()
00196                                  << " " << 1.0e9*mystrip.GetTime() << endl;
00197 }

void AlgFarDetStrip::Trace ( const char *  c  )  const [virtual]

Reimplemented from AlgBase.

Definition at line 199 of file AlgFarDetStrip.cxx.

00200 {
00201 
00202 }


The documentation for this class was generated from the following files:

Generated on 2 Nov 2017 for loon by  doxygen 1.6.1