FarDetStripListModule Class Reference

#include <FarDetStripListModule.h>

Inheritance diagram for FarDetStripListModule:
JobCModule

List of all members.

Public Member Functions

 FarDetStripListModule ()
 ~FarDetStripListModule ()
void BeginJob ()
JobCResult Reco (MomNavigator *mom)
JobCResult Ana (const MomNavigator *mom)
const RegistryDefaultConfig () const
void Config (const Registry &r)
void HandleCommand (JobCommand *command)
void EndJob ()

Private Member Functions

Int_t ApplyFilter (FarDetStripListHandle *csh)

Private Attributes

TFile * fFarDetStripFile
TTree * fFarDetStripTree
Int_t run
Int_t snarl
Int_t timeframe
Int_t time
Int_t date
Int_t plane
Int_t strip
Int_t ndigits
Int_t view
Int_t xtalk
Int_t crateE
Int_t varcE
Int_t vmmE
Int_t vaadcE
Int_t vachipE
Int_t vachannelE
Double_t CTrawE
Double_t CTcalE
Double_t QrawE
Double_t QcalE
Double_t QpeE
Double_t QsiglinE
Double_t QsigcorrE
Double_t QsigmapE
Double_t fibreE
Double_t greenE
Double_t clearE
Double_t pigtailE
Int_t crateW
Int_t varcW
Int_t vmmW
Int_t vaadcW
Int_t vachipW
Int_t vachannelW
Double_t CTrawW
Double_t CTcalW
Double_t QrawW
Double_t QcalW
Double_t QpeW
Double_t QsiglinW
Double_t QsigcorrW
Double_t QsigmapW
Double_t fibreW
Double_t greenW
Double_t clearW
Double_t pigtailW
Double_t halflength
Double_t Ltrk
Double_t Zstrp
Double_t Tstrp
Double_t dSfit
Double_t Tfit
Double_t Lfit
Double_t CTfit
Double_t U
Double_t V
Double_t X
Double_t Y
Double_t Z
Double_t pu
Double_t pv
Double_t pz
Double_t erru
Double_t errv
Int_t nplns
TString fListIn
TString fListOut
Int_t fMinPlane
Int_t fMaxPlane
Int_t fFilterOnOff
Int_t fFilterMinStrips
Int_t fFilter
TObjArray fStrpList [500]

Detailed Description

Definition at line 16 of file FarDetStripListModule.h.


Constructor & Destructor Documentation

FarDetStripListModule::FarDetStripListModule (  ) 

Definition at line 47 of file FarDetStripListModule.cxx.

00047                                              :
00048   fFarDetStripFile(0),
00049   fFarDetStripTree(0),
00050   fListIn("CandDigitListHandle"),
00051   fListOut("FarDetStripListHandle"),
00052   fFilterOnOff(0),
00053   fFilterMinStrips(-1),
00054   fFilter(0)
00055 {
00056 
00057 }

FarDetStripListModule::~FarDetStripListModule (  ) 

Definition at line 59 of file FarDetStripListModule.cxx.

00060 {
00061 
00062 }


Member Function Documentation

JobCResult FarDetStripListModule::Ana ( const MomNavigator mom  )  [virtual]

Implement this for read only access to the MomNavigator

Reimplemented from JobCModule.

Definition at line 130 of file FarDetStripListModule.cxx.

References clearE, clearW, crateE, crateW, CTcalE, CTcalW, CTfit, CTrawE, CTrawW, date, dSfit, erru, errv, fFarDetStripFile, fFarDetStripTree, fibreE, fibreW, CandRecord::FindCandHandle(), fStrpList, CandRecord::GetCandHeader(), FarDetStripHandle::GetCharge(), FarDetStripHandle::GetClearFibre(), RawChannelId::GetCrate(), CandHandle::GetDaughterIterator(), MomNavigator::GetFragment(), FarDetStripHandle::GetGreenFibre(), FarDetStripHandle::GetHalfLength(), CandHandle::GetNDaughters(), FarDetStripHandle::GetPlane(), CandStripHandle::GetPlaneView(), RawRecord::GetRawBlockIter(), PlexHandle::GetRawChannelId(), RawRecord::GetRawHeader(), CandHeader::GetRun(), RawDaqHeader::GetRun(), RawDaqSnarlHeader::GetSnarl(), CandHeader::GetSnarl(), FarDetStripHandle::GetStrip(), CandStripHandle::GetStripEndId(), FarDetStripHandle::GetTime(), RawDaqHeader::GetTimeFrameNum(), CandStripHandle::GetTPos(), RawSnarlHeaderBlock::GetTriggerTime(), RawChannelId::GetVaAdcSel(), RawChannelId::GetVaChannel(), RawChannelId::GetVaChip(), RawChannelId::GetVarcId(), RecMinos::GetVldContext(), RawChannelId::GetVmm(), FarDetStripHandle::GetWlsPigtail(), CandStripHandle::GetZPos(), greenE, greenW, halflength, FarDetStripHandle::IsXtalk(), Msg::kDebug, StripEnd::kNegative, CalTimeType::kNone, CalDigitType::kNone, JobCResult::kPassed, CalDigitType::kPE, StripEnd::kPositive, CalDigitType::kSigCorr, CalDigitType::kSigLin, CalTimeType::kT0, PlaneView::kU, PlaneView::kV, StripEnd::kWhole, Lfit, Ltrk, MSG, ndigits, nplns, pigtailE, pigtailW, plane, pu, pv, pz, QcalE, QcalW, QpeE, QpeW, QrawE, QrawW, QsigcorrE, QsigcorrW, QsiglinE, QsiglinW, QsigmapE, QsigmapW, run, JobCResult::SetFailed(), snarl, strip, Tfit, time, timeframe, Tstrp, U, V, vaadcE, vaadcW, vachannelE, vachannelW, vachipE, vachipW, varcE, varcW, view, vmmE, vmmW, X, xtalk, Y, Z, and Zstrp.

00131 {
00132   MSG("FarDetStrip",Msg::kDebug) << " *** FarDetStripListModule::Ana( ) *** " << endl;
00133 
00134   JobCResult result(JobCResult::kPassed);  
00135   run=-1; snarl=-1; timeframe=-1;
00136 
00137   Double_t trigger=0.0;
00138 
00139   RawRecord *rawrec = dynamic_cast<RawRecord *>(mom->GetFragment("RawRecord"));
00140   if(rawrec){
00141     const RawDaqSnarlHeader* rawheader = dynamic_cast<const RawDaqSnarlHeader*>(rawrec->GetRawHeader());
00142     if(rawheader){
00143       if(run<0) run = rawheader->GetRun(); 
00144       if(snarl<0) snarl = rawheader->GetSnarl();
00145       if(timeframe<0) timeframe = rawheader->GetTimeFrameNum();
00146     }
00147 
00148     TIter rawrecitr = rawrec->GetRawBlockIter();
00149     TObject *tob;
00150     while((tob = rawrecitr())){
00151       if(tob->InheritsFrom("RawSnarlHeaderBlock")){
00152         RawSnarlHeaderBlock* rdb = (RawSnarlHeaderBlock*)(tob);
00153         trigger = 1.0e-9*((VldTimeStamp)(rdb->GetTriggerTime())).GetNanoSec();
00154         date = (((VldTimeStamp)(rdb->GetTriggerTime())).GetSec()-1059696000)/(3600*24);
00155         time = (((VldTimeStamp)(rdb->GetTriggerTime())).GetSec()-1059696000)%(3600*24);
00156       }
00157     }
00158   }  
00159 
00160   CandRecord* candrec = dynamic_cast<CandRecord*>(mom->GetFragment("CandRecord","PrimaryCandidateRecord"));
00161   if(candrec==0){
00162     return result.SetFailed();
00163   }
00164 
00165   VldContext *vldc = (VldContext*)(candrec->GetVldContext());
00166   UgliGeomHandle ugh(*vldc);
00167   PlexHandle ph(*vldc);
00168   CandHeader* candheader = (CandHeader*)(candrec->GetCandHeader());
00169   if(run<0) run = candheader->GetRun();
00170   if(snarl<0) snarl = candheader->GetSnarl();
00171 
00172   FarDetStripListHandle* strplist = dynamic_cast<FarDetStripListHandle*>(candrec->FindCandHandle("FarDetStripListHandle"));
00173   if(strplist==0){
00174     return result.SetFailed();
00175   }
00176 
00177   if(!fFarDetStripFile){      
00178     // TString mystring("results/fardet.strip");  
00179     // mystring.Append("."); mystring+=run; 
00180     // mystring.Append(".root");
00181     TString mystring("fardet.strip.root");
00182     TDirectory* tmpd = gDirectory;
00183     fFarDetStripFile = new TFile(mystring.Data(),"RECREATE");
00184     fFarDetStripTree = new TTree("StripTree","StripTree");
00185     fFarDetStripTree->SetAutoSave(100);
00186 
00187     fFarDetStripTree->Branch("run",&run,"run/I");
00188     fFarDetStripTree->Branch("snarl",&snarl,"snarl/I");
00189     fFarDetStripTree->Branch("timeframe",&timeframe,"timeframe/I");
00190     fFarDetStripTree->Branch("time",&time,"time/I");
00191     fFarDetStripTree->Branch("date",&date,"date/I");
00192     fFarDetStripTree->Branch("plane",&plane,"plane/I");
00193     fFarDetStripTree->Branch("strip",&strip,"strip/I");
00194     fFarDetStripTree->Branch("ndigits",&ndigits,"ndigits/I");
00195     fFarDetStripTree->Branch("view",&view,"view/I");
00196     fFarDetStripTree->Branch("xtalk",&xtalk,"xtalk/I");
00197     
00198     fFarDetStripTree->Branch("crateE",&crateE,"crateE/I");
00199     fFarDetStripTree->Branch("varcE",&varcE,"varcE/I");
00200     fFarDetStripTree->Branch("vmmE",&vmmE,"vmmE/I");
00201     fFarDetStripTree->Branch("vaadcE",&vaadcE,"vaadcE/I");
00202     fFarDetStripTree->Branch("vachipE",&vachipE,"vachipE/I");
00203     fFarDetStripTree->Branch("vachannelE",&vachannelE,"vachannelE/I");
00204     fFarDetStripTree->Branch("CTrawE",&CTrawE,"CTrawE/D");
00205     fFarDetStripTree->Branch("CTcalE",&CTcalE,"CTcalE/D");
00206     fFarDetStripTree->Branch("QrawE",&QrawE,"QrawE/D");
00207     fFarDetStripTree->Branch("QcalE",&QcalE,"QcalE/D");
00208     fFarDetStripTree->Branch("QpeE",&QpeE,"QpeE/D");
00209     fFarDetStripTree->Branch("QsiglinE",&QsiglinE,"QsiglinE/D");
00210     fFarDetStripTree->Branch("QsigcorrE",&QsigcorrE,"QsigcorrE/D");
00211     fFarDetStripTree->Branch("QsigmapE",&QsigmapE,"QsigmapE/D");
00212     fFarDetStripTree->Branch("fibreE",&fibreE,"fibreE/D");
00213     fFarDetStripTree->Branch("greenE",&greenE,"greenE/D");
00214     fFarDetStripTree->Branch("clearE",&clearE,"clearE/D");
00215     fFarDetStripTree->Branch("pigtailE",&pigtailE,"pigtailE/D");
00216    
00217     fFarDetStripTree->Branch("crateW",&crateW,"cratetW/I");
00218     fFarDetStripTree->Branch("varcW",&varcW,"varcW/I");
00219     fFarDetStripTree->Branch("vmmW",&vmmW,"vmmW/I");
00220     fFarDetStripTree->Branch("vaadcW",&vaadcW,"vaadcW/I");
00221     fFarDetStripTree->Branch("vachipW",&vachipW,"vachipW/I");
00222     fFarDetStripTree->Branch("vachannelW",&vachannelW,"vachannelW/I");
00223     fFarDetStripTree->Branch("CTrawW",&CTrawW,"CTrawW/D");
00224     fFarDetStripTree->Branch("CTcalW",&CTcalW,"CTcalW/D");
00225     fFarDetStripTree->Branch("QrawW",&QrawW,"QrawW/D");
00226     fFarDetStripTree->Branch("QcalW",&QcalW,"QcalW/D");
00227     fFarDetStripTree->Branch("QpeW",&QpeW,"QpeW/D");
00228     fFarDetStripTree->Branch("QsiglinW",&QsiglinW,"QsiglinW/D");
00229     fFarDetStripTree->Branch("QsigcorrW",&QsigcorrW,"QsigcorrW/D");
00230     fFarDetStripTree->Branch("QsigmapW",&QsigmapW,"QsigmapW/D");
00231     fFarDetStripTree->Branch("fibreW",&fibreW,"fibreW/D");
00232     fFarDetStripTree->Branch("greenW",&greenW,"greenW/D");
00233     fFarDetStripTree->Branch("clearW",&clearW,"clearW/D");
00234     fFarDetStripTree->Branch("pigtailW",&pigtailW,"pigtailW/D");
00235 
00236     fFarDetStripTree->Branch("halflength",&halflength,"halflength/D");
00237     fFarDetStripTree->Branch("Ltrk",&Ltrk,"Ltrk/D");
00238     
00239     fFarDetStripTree->Branch("Zstrp",&Zstrp,"Zstrp/D");
00240     fFarDetStripTree->Branch("Tstrp",&Tstrp,"Tstrp/D");
00241     fFarDetStripTree->Branch("dSfit",&dSfit,"dSfit/D");
00242     fFarDetStripTree->Branch("Tfit",&Tfit,"Tfit/D");
00243     fFarDetStripTree->Branch("Lfit",&Lfit,"Lfit/D");
00244     fFarDetStripTree->Branch("CTfit",&CTfit,"CTfit/D");
00245     fFarDetStripTree->Branch("U",&U,"U/D");
00246     fFarDetStripTree->Branch("V",&V,"V/D");
00247     fFarDetStripTree->Branch("X",&X,"X/D");
00248     fFarDetStripTree->Branch("Y",&Y,"Y/D");
00249     fFarDetStripTree->Branch("Z",&Z,"Z/D");
00250 
00251     fFarDetStripTree->Branch("pu",&pu,"pu/D");
00252     fFarDetStripTree->Branch("pv",&pv,"pv/D");
00253     fFarDetStripTree->Branch("pz",&pz,"pz/D");
00254     fFarDetStripTree->Branch("erru",&erru,"erru/D");
00255     fFarDetStripTree->Branch("errv",&errv,"errv/D");
00256     fFarDetStripTree->Branch("nplns",&nplns,"nplns/I");
00257 
00258     gDirectory = tmpd;
00259   }
00260 
00261   Int_t pln;
00262 
00263   TIter strpitr(strplist->GetDaughterIterator());
00264   while(FarDetStripHandle* strp = dynamic_cast<FarDetStripHandle*>(strpitr())){
00265     if(strp){
00266       pln=strp->GetPlane();
00267       if(pln>-1 && pln<500){
00268         fStrpList[pln].Add(strp);
00269       }
00270     }
00271   }
00272 
00273   Int_t i;
00274   Int_t uflag=0,vflag=0;
00275   Double_t dt,t,z,q;
00276   Double_t Uwuu=0.0,Uwzz=0.0,Uwzu=0.0,Uwu=0.0,Uwz=0.0,Uw=0.0;
00277   Double_t Vwvv=0.0,Vwzz=0.0,Vwzv=0.0,Vwv=0.0,Vwz=0.0,Vw=0.0;
00278   Int_t uplns=0,vplns=0;
00279   Double_t zmin=-999.9,zmax=-999.0;
00280 
00281   // *** DO STRAIGHT LINE FIT ***
00282   for(pln=0;pln<500;pln++){
00283     uflag=0; vflag=0;
00284 
00285     for(i=0;i<1+fStrpList[pln].GetLast();i++){
00286       FarDetStripHandle* strp = (FarDetStripHandle*)(fStrpList[pln].At(i));
00287 
00288       xtalk=strp->IsXtalk(StripEnd::kWhole);
00289 
00290       q=strp->GetCharge();
00291       t=strp->GetTPos(); z=strp->GetZPos();
00292       if( !xtalk && q>2.0 ){
00293 
00294         if( strp->GetPlaneView()==PlaneView::kU ){
00295           Uwuu+=q*t*t; Uwzu+=q*t*z; Uwzz+=q*z*z;
00296           Uwu+=q*t; Uwz+=q*z; Uw+=q;
00297           uflag=1;
00298         }
00299         if( strp->GetPlaneView()==PlaneView::kV ){
00300           Vwvv+=q*t*t; Vwzv+=q*t*z; Vwzz+=q*z*z;
00301           Vwv+=q*t; Vwz+=q*z; Vw+=q;
00302           vflag=1;
00303         }
00304 
00305         if( zmin<0||z<zmin ){ zmin=z; }  if( zmax<0||z>zmax ){ zmax=z; }
00306       }
00307     }
00308 
00309     if(uflag) uplns++; if(vflag) vplns++;
00310   }
00311 
00312   Double_t mu,mv,cu,cv;
00313   Double_t opos,tpos,upos,vpos;  
00314 
00315   // *** SELECT EVENTS ***
00316   if( uplns>3 && vplns>3 ){
00317 
00318     mu=(Uw*Uwzu-Uwz*Uwu)/(Uw*Uwzz-Uwz*Uwz); cu=(Uwu*Uwzz-Uwz*Uwzu)/(Uw*Uwzz-Uwz*Uwz);
00319     mv=(Vw*Vwzv-Vwz*Vwv)/(Vw*Vwzz-Vwz*Vwz); cv=(Vwv*Vwzz-Vwz*Vwzv)/(Vw*Vwzz-Vwz*Vwz);
00320 
00321     erru=(Uwuu-2.0*mu*Uwzu-2.0*cu*Uwu+mu*mu*Uwzz+2.0*mu*cu*Uwz+Uw*cu*cu)/(Uw);
00322     errv=(Vwvv-2.0*mv*Vwzv-2.0*cv*Vwv+mv*mv*Vwzz+2.0*mv*cv*Vwz+Vw*cv*cv)/(Vw);
00323     nplns=uplns+vplns;
00324 
00325     if( erru<0.01 && errv<0.01 && nplns>10 ){
00326 
00327       if( mu+mv>=0 ){
00328         pu=-mu/sqrt(mu*mu+mv*mv+1.0);
00329         pv=-mv/sqrt(mu*mu+mv*mv+1.0);
00330         pz=-1.0/sqrt(mu*mu+mv*mv+1.0);
00331       }
00332       else{   
00333         pu=mu/sqrt(mu*mu+mv*mv+1.0);
00334         pv=mv/sqrt(mu*mu+mv*mv+1.0);
00335         pz=1.0/sqrt(mu*mu+mv*mv+1.0);
00336       }
00337 
00338       // *** WRITE OUT STRIPS ON TRACK ***
00339       MSG("FarDetStrip",Msg::kDebug) << " COSMIC MUON AT TIME = " << timeframe << endl;
00340 
00341       for(pln=0;pln<500;pln++){
00342         for(i=0;i<1+fStrpList[pln].GetLast();i++){
00343           FarDetStripHandle* strp = (FarDetStripHandle*)(fStrpList[pln].At(i));
00344     
00345           view=-1;
00346           plane=strp->GetPlane(); strip=strp->GetStrip();
00347           ndigits=strp->GetNDaughters();
00348           
00349           CTrawE=0.0; CTcalE=0.0; 
00350           QrawE=0.0; QcalE=0.0; QpeE=0.0; QsiglinE=0.0; QsigcorrE=0.0; QsigmapE=0.0;
00351           CTrawW=0.0; CTcalW=0.0; 
00352           QrawW=0.0; QcalW=0.0; QpeW=0.0; QsiglinW=0.0; QsigcorrW=0.0; QsigmapW=0.0;
00353           CTfit=0.0;
00354 
00355           t=strp->GetTPos(); z=strp->GetZPos();
00356           Zstrp=z; Tstrp=t; 
00357           upos=mu*z+cu; vpos=mv*z+cv;
00358           opos=0.0; tpos=0.0; dt=0.0;
00359           U=upos; V=vpos; 
00360           X=0.7071*(U-V); Y=0.7071*(U+V);
00361           Z=z;
00362 
00363           if( strp->GetPlaneView()==PlaneView::kU ){
00364             view=0; dt=t-upos;
00365             tpos=upos; opos=-vpos;
00366             Tfit=upos; Lfit=vpos;
00367           }
00368           if( strp->GetPlaneView()==PlaneView::kV ){
00369             view=1; dt=t-vpos;
00370             tpos=vpos; opos=upos;
00371             Tfit=vpos; Lfit=upos;
00372           }
00373 
00374           halflength=strp->GetHalfLength();
00375 
00376           greenW=strp->GetGreenFibre(StripEnd::kPositive)-opos; 
00377           pigtailW=strp->GetWlsPigtail(StripEnd::kPositive);
00378           clearW=strp->GetClearFibre(StripEnd::kPositive);
00379           fibreW=greenW+pigtailW+clearW;
00380 
00381           PlexStripEndId stripidW = strp->GetStripEndId(StripEnd::kPositive);
00382           RawChannelId rawchW = ph.GetRawChannelId(stripidW);     
00383           crateW = rawchW.GetCrate();
00384           varcW = rawchW.GetVarcId();
00385           vmmW = rawchW.GetVmm();
00386           vaadcW = rawchW.GetVaAdcSel();
00387           vachipW = rawchW.GetVaChip();
00388           vachannelW = rawchW.GetVaChannel();
00389               
00390           CTrawW=3.0e8*(strp->GetTime(StripEnd::kPositive,CalTimeType::kNone));
00391           CTcalW=3.0e8*(strp->GetTime(StripEnd::kPositive,CalTimeType::kT0));
00392           QrawW=strp->GetCharge(StripEnd::kPositive,CalDigitType::kNone);
00393           QcalW=strp->GetCharge(StripEnd::kPositive,CalDigitType::kPE);
00394           QpeW=strp->GetCharge(StripEnd::kPositive,CalDigitType::kPE);
00395           QsiglinW=strp->GetCharge(StripEnd::kPositive,CalDigitType::kSigLin);
00396           QsigcorrW=strp->GetCharge(StripEnd::kPositive,CalDigitType::kSigCorr);
00397           QsigmapW=0.0;
00398 
00399           greenE=strp->GetGreenFibre(StripEnd::kNegative)+opos;
00400           pigtailE=strp->GetWlsPigtail(StripEnd::kNegative); 
00401           clearE=strp->GetClearFibre(StripEnd::kNegative);
00402           fibreE=greenE+pigtailE+clearE;              
00403 
00404           PlexStripEndId stripidE = strp->GetStripEndId(StripEnd::kNegative);
00405           RawChannelId rawchE = ph.GetRawChannelId(stripidE);
00406           crateE = rawchE.GetCrate();
00407           varcE = rawchE.GetVarcId();
00408           vmmE = rawchE.GetVmm();
00409           vaadcE = rawchE.GetVaAdcSel();
00410           vachipE = rawchE.GetVaChip();
00411           vachannelE = rawchE.GetVaChannel();   
00412 
00413           CTrawE=3.0e8*(strp->GetTime(StripEnd::kNegative,CalTimeType::kNone));
00414           CTcalE=3.0e8*(strp->GetTime(StripEnd::kNegative,CalTimeType::kT0));
00415           QrawE=strp->GetCharge(StripEnd::kNegative,CalDigitType::kNone);
00416           QcalE=strp->GetCharge(StripEnd::kNegative,CalDigitType::kPE);
00417           QpeE=strp->GetCharge(StripEnd::kNegative,CalDigitType::kPE);
00418           QsiglinE=strp->GetCharge(StripEnd::kNegative,CalDigitType::kSigLin);
00419           QsigcorrE=strp->GetCharge(StripEnd::kNegative,CalDigitType::kSigCorr);
00420           QsigmapE=0.0;
00421 
00422           if( mu+mv>=0 ){
00423             dSfit=(zmax-z)*sqrt(mu*mu+mv*mv+1.0);
00424           }
00425           else{
00426             dSfit=(z-zmin)*sqrt(mu*mu+mv*mv+1.0);
00427           } 
00428           Ltrk=dSfit;
00429 
00430           xtalk=strp->IsXtalk(StripEnd::kWhole);
00431 
00432           if( dt>-0.06 && dt<0.06 ){
00433             if(fFarDetStripFile){
00434               TDirectory* tmpdd = gDirectory;
00435               fFarDetStripFile->cd();
00436               fFarDetStripTree->Fill();
00437               gDirectory = tmpdd;
00438             }
00439           }
00440 
00441         }
00442       }
00443 
00444     }
00445   }
00446 
00447   for(pln=0;pln<500;pln++){
00448     fStrpList[pln].Clear();
00449   }
00450 
00451   return result;
00452 }

Int_t FarDetStripListModule::ApplyFilter ( FarDetStripListHandle csh  )  [private]

Definition at line 543 of file FarDetStripListModule.cxx.

References fFilterMinStrips, Msg::kDebug, and MSG.

Referenced by Reco().

00544 {
00545   Int_t filter=0;
00546 
00547   MSG("FarDetStrip",Msg::kDebug) 
00548     << "  *** STRIP FILTER *** " << endl
00549     << "    Good Strips = ..." << endl;
00550 
00551   if( 0>fFilterMinStrips ) filter=1;
00552 
00553   return filter;
00554 }

void FarDetStripListModule::BeginJob ( void   )  [virtual]

Implement for notification of begin of job

Reimplemented from JobCModule.

Definition at line 64 of file FarDetStripListModule.cxx.

References Msg::kDebug, and MSG.

00065 {
00066   MSG("FarDetStrip",Msg::kDebug) << " *** FarDetStripListModule::BeginJob( ) *** " << endl;
00067 
00068   /*
00069   AlgFactory &af = AlgFactory::GetInstance();
00070   af.Register("AlgFarDetStripList","default","libFarDetStrip.so","AlgConfig");
00071   af.Register("AlgFarDetStrip","default","libFarDetStrip.so","AlgConfig");
00072   */
00073 }

void FarDetStripListModule::Config ( const Registry r  )  [virtual]

Return the actual configuration. If your module directly pulls its configuration from the fConfig Registry, you don't need to override this. Override if you have local config variables.

Reimplemented from JobCModule.

Definition at line 486 of file FarDetStripListModule.cxx.

References fFilterMinStrips, fFilterOnOff, fListIn, fListOut, Registry::Get(), AlgHandle::GetAlgConfig(), AlgFactory::GetAlgHandle(), AlgFactory::GetInstance(), Msg::kDebug, Registry::LockValues(), MSG, Registry::Set(), and Registry::UnLockValues().

00487 {
00488   MSG("FarDetStrip",Msg::kDebug) << " *** FarDetStripListModule::Config( ) *** " << endl;
00489 
00490   Int_t tmpint; const char* tmpchar = 0;
00491 
00492   if(r.Get("FilterOnOff",tmpint)) fFilterOnOff = tmpint;
00493   if(r.Get("FilterMinStrips",tmpint)) fFilterMinStrips = tmpint;
00494   if(r.Get("ListIn",tmpchar)) fListIn = tmpchar;
00495   if(r.Get("ListOut",tmpchar)) fListOut = tmpchar;
00496 
00497   AlgFactory &af = AlgFactory::GetInstance();
00498 
00499   AlgHandle ah_list = af.GetAlgHandle("AlgFarDetStripList","default");
00500   AlgConfig &ac_list = ah_list.GetAlgConfig();
00501   ac_list.UnLockValues();
00502   if(r.Get("RemoveCrossTalk",tmpint)) ac_list.Set("RemoveCrossTalk",tmpint);
00503   ac_list.LockValues();
00504 
00505   AlgHandle ah_strip = af.GetAlgHandle("AlgFarDetStrip","default");
00506   AlgConfig &ac_strip = ah_strip.GetAlgConfig();
00507   ac_strip.UnLockValues();
00508   ac_strip.LockValues();
00509 
00510   MSG("FarDetStrip",Msg::kDebug) << "  configuration : " << endl
00511                                 << "     FilterOnOff=" << fFilterOnOff << endl
00512                                 << "     FilterMinStrips=" << fFilterMinStrips << endl
00513                                 << "     ListIn=" << fListIn.Data() << endl
00514                                 << "     ListOut=" << fListOut.Data() << endl;
00515     
00516   return;
00517 }

const Registry & FarDetStripListModule::DefaultConfig ( void   )  const [virtual]

Get the default configuration registry. This should normally be overridden. One useful idiom is to implement it like:

const Registry& MyModule::DefaultConfig() const { static Registry cfg; // never is destroyed if (cfg.Size()) return cfg; // already filled it // set defaults: cfg.Set("TheAnswer",42); cfg.Set("Units","unknown"); return cfg; }

Reimplemented from JobCModule.

Definition at line 454 of file FarDetStripListModule.cxx.

References fFilterMinStrips, fFilterOnOff, fListIn, fListOut, AlgHandle::GetAlgConfig(), AlgFactory::GetAlgHandle(), AlgFactory::GetInstance(), Msg::kDebug, Registry::LockValues(), MSG, AlgFactory::Register(), Registry::Set(), and Registry::UnLockValues().

00455 {
00456   MSG("FarDetStrip",Msg::kDebug) << " *** FarDetStripListModule::DefaultConfig( ) *** " << endl;
00457 
00458   static Registry r;
00459   r.SetName("FarDetStripListModule.config.default");
00460   r.UnLockValues();
00461   r.Set("FilterOnOff",fFilterOnOff);
00462   r.Set("FilterMinStrips",fFilterMinStrips);
00463   r.Set("ListIn",fListIn);
00464   r.Set("ListOut",fListOut);
00465   r.Set("RemoveCrossTalk",0);
00466   r.LockValues();
00467 
00468   AlgFactory &af = AlgFactory::GetInstance();
00469 
00470   af.Register("AlgFarDetStripList","default");
00471   AlgHandle ah_list = af.GetAlgHandle("AlgFarDetStripList","default");
00472   AlgConfig &ac_list = ah_list.GetAlgConfig();
00473   ac_list.UnLockValues();
00474   ac_list.Set("RemoveCrossTalk",0);
00475   ac_list.LockValues();
00476 
00477   af.Register("AlgFarDetStrip","default");
00478   AlgHandle ah_strip = af.GetAlgHandle("AlgFarDetStrip","default");
00479   AlgConfig &ac_strip = ah_strip.GetAlgConfig();
00480   ac_strip.UnLockValues();
00481   ac_strip.LockValues();
00482 
00483   return r;
00484 }

void FarDetStripListModule::EndJob (  )  [virtual]

Implement for notification of end of job

Reimplemented from JobCModule.

Definition at line 528 of file FarDetStripListModule.cxx.

References fFarDetStripFile, fFarDetStripTree, Msg::kDebug, and MSG.

00529 {
00530   MSG("FarDetStrip",Msg::kDebug) << " *** FarDetStripListModule::EndJob( ) *** " << endl;
00531 
00532   if(fFarDetStripFile){
00533     MSG("FarDetStrip",Msg::kDebug) << " *** saving STRIP INFO to file *** " << endl;
00534     TDirectory* tmpddd = gDirectory;
00535     fFarDetStripFile->cd();
00536     fFarDetStripTree->Write();
00537     fFarDetStripFile->Close();
00538     gDirectory = tmpddd;
00539     MSG("FarDetStrip",Msg::kDebug) << "    ... data saved to file *** " << endl;
00540   }
00541 }

void FarDetStripListModule::HandleCommand ( JobCommand command  )  [virtual]

Implement to handle a JobCommand

Reimplemented from JobCModule.

Definition at line 519 of file FarDetStripListModule.cxx.

References JobCommand::PopCmd(), and JobCommand::PopOpt().

00520 {
00521   TString cmd = command->PopCmd();
00522   if(cmd=="Set"){
00523     TString opt = command->PopOpt();
00524 
00525   }
00526 }

JobCResult FarDetStripListModule::Reco ( MomNavigator mom  )  [virtual]

Implement this for read-write access to the MomNavigator

Reimplemented from JobCModule.

Definition at line 75 of file FarDetStripListModule.cxx.

References ApplyFilter(), fFilter, fFilterOnOff, CandRecord::FindCandHandle(), fListIn, fListOut, AlgFactory::GetAlgHandle(), MomNavigator::GetFragment(), AlgFactory::GetInstance(), Msg::kDebug, JobCResult::kPassed, FarDetStripList::MakeCandidate(), MSG, CandRecord::SecureCandHandle(), CandContext::SetCandRecord(), CandContext::SetDataIn(), JobCResult::SetFailed(), CandHandle::SetName(), JobCResult::SetPassed(), and CandHandle::SetTitle().

00076 {
00077   MSG("FarDetStrip",Msg::kDebug) << " *** FarDetStripListModule::Reco( ) *** " << endl;
00078 
00079   fFilter=0;
00080   JobCResult result(JobCResult::kPassed);
00081 
00082   // get candrecord
00083   CandRecord* candrec = dynamic_cast<CandRecord*>(mom->GetFragment("CandRecord","PrimaryCandidateRecord"));
00084   if( candrec==0 ){
00085     MSG("FarDetStrip",Msg::kDebug) << "  *** FAILED TO FIND CANDRECORD *** " << endl;
00086     return result.SetFailed();
00087   }
00088 
00089   // make striplist handle
00090   CandDigitListHandle* cdlh = dynamic_cast<CandDigitListHandle*>(candrec->FindCandHandle("CandDigitListHandle",fListIn.Data()));
00091   if( cdlh){
00092     MSG("FarDetStrip",Msg::kDebug) << "  *** MAKE HANDLE *** " << endl;
00093 
00094     AlgFactory &af = AlgFactory::GetInstance();
00095     AlgHandle ah = af.GetAlgHandle("AlgFarDetStripList", "default");
00096   
00097     CandContext cx(this, mom);
00098     cx.SetCandRecord(candrec);
00099     cx.SetDataIn(cdlh);
00100     FarDetStripListHandle strplist = FarDetStripList::MakeCandidate(ah,cx);
00101     strplist.SetName(fListOut.Data());
00102     strplist.SetTitle(TString("Created by FarDetStripListModule"));
00103 
00104     candrec->SecureCandHandle(strplist);
00105   }
00106 
00107   // contained event filter 
00108   FarDetStripListHandle* csh = dynamic_cast<FarDetStripListHandle*>(candrec->FindCandHandle("FarDetStripListHandle"));
00109   if( csh ){
00110     fFilter = this->ApplyFilter(csh);
00111   }
00112 
00113   // apply filter
00114   if( fFilterOnOff ){
00115     MSG("FarDetStrip",Msg::kDebug) << "  *** APPLY FILTER *** " << endl;
00116 
00117     if( fFilter ){
00118       MSG("FarDetStrip",Msg::kDebug) << "   *** PASSED FILTER *** " << endl;      
00119       return result.SetPassed(); 
00120     }
00121     else{
00122       MSG("FarDetStrip",Msg::kDebug) << "   *** FAILED FILTER *** " << endl;      
00123       return result.SetFailed();
00124     } 
00125   }
00126 
00127   return result;
00128 }


Member Data Documentation

Double_t FarDetStripListModule::clearE [private]

Definition at line 40 of file FarDetStripListModule.h.

Referenced by Ana().

Double_t FarDetStripListModule::clearW [private]

Definition at line 44 of file FarDetStripListModule.h.

Referenced by Ana().

Definition at line 38 of file FarDetStripListModule.h.

Referenced by Ana().

Definition at line 42 of file FarDetStripListModule.h.

Referenced by Ana().

Double_t FarDetStripListModule::CTcalE [private]

Definition at line 39 of file FarDetStripListModule.h.

Referenced by Ana().

Double_t FarDetStripListModule::CTcalW [private]

Definition at line 43 of file FarDetStripListModule.h.

Referenced by Ana().

Double_t FarDetStripListModule::CTfit [private]

Definition at line 50 of file FarDetStripListModule.h.

Referenced by Ana().

Double_t FarDetStripListModule::CTrawE [private]

Definition at line 39 of file FarDetStripListModule.h.

Referenced by Ana().

Double_t FarDetStripListModule::CTrawW [private]

Definition at line 43 of file FarDetStripListModule.h.

Referenced by Ana().

Int_t FarDetStripListModule::date [private]

Definition at line 35 of file FarDetStripListModule.h.

Referenced by Ana().

Double_t FarDetStripListModule::dSfit [private]

Definition at line 50 of file FarDetStripListModule.h.

Referenced by Ana().

Double_t FarDetStripListModule::erru [private]

Definition at line 53 of file FarDetStripListModule.h.

Referenced by Ana().

Double_t FarDetStripListModule::errv [private]

Definition at line 53 of file FarDetStripListModule.h.

Referenced by Ana().

Definition at line 31 of file FarDetStripListModule.h.

Referenced by Ana(), and EndJob().

Definition at line 32 of file FarDetStripListModule.h.

Referenced by Ana(), and EndJob().

Definition at line 60 of file FarDetStripListModule.h.

Referenced by Reco().

Definition at line 59 of file FarDetStripListModule.h.

Referenced by ApplyFilter(), Config(), and DefaultConfig().

Definition at line 58 of file FarDetStripListModule.h.

Referenced by Config(), DefaultConfig(), and Reco().

Double_t FarDetStripListModule::fibreE [private]

Definition at line 40 of file FarDetStripListModule.h.

Referenced by Ana().

Double_t FarDetStripListModule::fibreW [private]

Definition at line 44 of file FarDetStripListModule.h.

Referenced by Ana().

TString FarDetStripListModule::fListIn [private]

Definition at line 56 of file FarDetStripListModule.h.

Referenced by Config(), DefaultConfig(), and Reco().

Definition at line 56 of file FarDetStripListModule.h.

Referenced by Config(), DefaultConfig(), and Reco().

Definition at line 57 of file FarDetStripListModule.h.

Definition at line 57 of file FarDetStripListModule.h.

TObjArray FarDetStripListModule::fStrpList[500] [private]

Definition at line 62 of file FarDetStripListModule.h.

Referenced by Ana().

Double_t FarDetStripListModule::greenE [private]

Definition at line 40 of file FarDetStripListModule.h.

Referenced by Ana().

Double_t FarDetStripListModule::greenW [private]

Definition at line 44 of file FarDetStripListModule.h.

Referenced by Ana().

Definition at line 46 of file FarDetStripListModule.h.

Referenced by Ana().

Double_t FarDetStripListModule::Lfit [private]

Definition at line 50 of file FarDetStripListModule.h.

Referenced by Ana().

Double_t FarDetStripListModule::Ltrk [private]

Definition at line 48 of file FarDetStripListModule.h.

Referenced by Ana().

Definition at line 36 of file FarDetStripListModule.h.

Referenced by Ana().

Definition at line 54 of file FarDetStripListModule.h.

Referenced by Ana().

Double_t FarDetStripListModule::pigtailE [private]

Definition at line 40 of file FarDetStripListModule.h.

Referenced by Ana().

Double_t FarDetStripListModule::pigtailW [private]

Definition at line 44 of file FarDetStripListModule.h.

Referenced by Ana().

Definition at line 36 of file FarDetStripListModule.h.

Referenced by Ana().

Double_t FarDetStripListModule::pu [private]

Definition at line 52 of file FarDetStripListModule.h.

Referenced by Ana().

Double_t FarDetStripListModule::pv [private]

Definition at line 52 of file FarDetStripListModule.h.

Referenced by Ana().

Double_t FarDetStripListModule::pz [private]

Definition at line 52 of file FarDetStripListModule.h.

Referenced by Ana().

Double_t FarDetStripListModule::QcalE [private]

Definition at line 39 of file FarDetStripListModule.h.

Referenced by Ana().

Double_t FarDetStripListModule::QcalW [private]

Definition at line 43 of file FarDetStripListModule.h.

Referenced by Ana().

Double_t FarDetStripListModule::QpeE [private]

Definition at line 39 of file FarDetStripListModule.h.

Referenced by Ana().

Double_t FarDetStripListModule::QpeW [private]

Definition at line 43 of file FarDetStripListModule.h.

Referenced by Ana().

Double_t FarDetStripListModule::QrawE [private]

Definition at line 39 of file FarDetStripListModule.h.

Referenced by Ana().

Double_t FarDetStripListModule::QrawW [private]

Definition at line 43 of file FarDetStripListModule.h.

Referenced by Ana().

Definition at line 39 of file FarDetStripListModule.h.

Referenced by Ana().

Definition at line 43 of file FarDetStripListModule.h.

Referenced by Ana().

Double_t FarDetStripListModule::QsiglinE [private]

Definition at line 39 of file FarDetStripListModule.h.

Referenced by Ana().

Double_t FarDetStripListModule::QsiglinW [private]

Definition at line 43 of file FarDetStripListModule.h.

Referenced by Ana().

Double_t FarDetStripListModule::QsigmapE [private]

Definition at line 39 of file FarDetStripListModule.h.

Referenced by Ana().

Double_t FarDetStripListModule::QsigmapW [private]

Definition at line 43 of file FarDetStripListModule.h.

Referenced by Ana().

Int_t FarDetStripListModule::run [private]

Definition at line 34 of file FarDetStripListModule.h.

Referenced by Ana().

Definition at line 34 of file FarDetStripListModule.h.

Referenced by Ana().

Definition at line 36 of file FarDetStripListModule.h.

Referenced by Ana().

Double_t FarDetStripListModule::Tfit [private]

Definition at line 50 of file FarDetStripListModule.h.

Referenced by Ana().

Int_t FarDetStripListModule::time [private]

Definition at line 35 of file FarDetStripListModule.h.

Referenced by Ana().

Definition at line 35 of file FarDetStripListModule.h.

Referenced by Ana().

Double_t FarDetStripListModule::Tstrp [private]

Definition at line 49 of file FarDetStripListModule.h.

Referenced by Ana().

Double_t FarDetStripListModule::U [private]

Definition at line 51 of file FarDetStripListModule.h.

Referenced by Ana().

Double_t FarDetStripListModule::V [private]

Definition at line 51 of file FarDetStripListModule.h.

Referenced by Ana().

Definition at line 38 of file FarDetStripListModule.h.

Referenced by Ana().

Definition at line 42 of file FarDetStripListModule.h.

Referenced by Ana().

Definition at line 38 of file FarDetStripListModule.h.

Referenced by Ana().

Definition at line 42 of file FarDetStripListModule.h.

Referenced by Ana().

Definition at line 38 of file FarDetStripListModule.h.

Referenced by Ana().

Definition at line 42 of file FarDetStripListModule.h.

Referenced by Ana().

Definition at line 38 of file FarDetStripListModule.h.

Referenced by Ana().

Definition at line 42 of file FarDetStripListModule.h.

Referenced by Ana().

Int_t FarDetStripListModule::view [private]

Definition at line 36 of file FarDetStripListModule.h.

Referenced by Ana().

Int_t FarDetStripListModule::vmmE [private]

Definition at line 38 of file FarDetStripListModule.h.

Referenced by Ana().

Int_t FarDetStripListModule::vmmW [private]

Definition at line 42 of file FarDetStripListModule.h.

Referenced by Ana().

Double_t FarDetStripListModule::X [private]

Definition at line 51 of file FarDetStripListModule.h.

Referenced by Ana().

Definition at line 36 of file FarDetStripListModule.h.

Referenced by Ana().

Double_t FarDetStripListModule::Y [private]

Definition at line 51 of file FarDetStripListModule.h.

Referenced by Ana().

Double_t FarDetStripListModule::Z [private]

Definition at line 51 of file FarDetStripListModule.h.

Referenced by Ana().

Double_t FarDetStripListModule::Zstrp [private]

Definition at line 49 of file FarDetStripListModule.h.

Referenced by Ana().


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

Generated on 2 Nov 2017 for loon by  doxygen 1.6.1