FarDetRawRateDump Class Reference

#include <FarDetRawRateDump.h>

Inheritance diagram for FarDetRawRateDump:
JobCModule

List of all members.

Public Member Functions

 FarDetRawRateDump ()
 ~FarDetRawRateDump ()
void BeginJob ()
JobCResult Ana (const MomNavigator *mom)
const RegistryDefaultConfig () const
void Config (const Registry &r)
void EndJob ()

Private Member Functions

void PrintRunSummary ()

Private Attributes

TFile * fRawRateFile
TTree * fRawRateTree
Int_t fTimeInterval
Int_t run
Int_t time
Int_t date
Int_t rate
Int_t deadchip
Int_t LI
Int_t chargePreTrig
Int_t ratePreTrig
Int_t entriesPreTrig
Int_t chargePostTrig
Int_t ratePostTrig
Int_t entriesPostTrig
Int_t rateSingles
Int_t entriesSingles
Int_t maxSingles
Int_t minSingles
Int_t crate
Int_t varc
Int_t vmm
Int_t vaadc
Int_t vachip
Int_t vachannel
Int_t flag
Int_t shld
Int_t plane
Int_t time0
Int_t timeframe
Int_t timeframenum
Double_t t
Double_t nanosec
Double_t tnanosec
Int_t adc
Int_t tdc
Int_t PlnMask [16][24]
Int_t PlnChMask [22]
Int_t VaCh2Shld [16][6]
Int_t VaCh2LiBox [22]
Int_t VaMaskDead [16][3][6][2][3]
Int_t VaMaskLI [16][3][6][2][3]
Int_t VaMaskChargePreTrig [16][3][6][2][3]
Int_t VaMaskRatePreTrig [16][3][6][2][3]
Int_t VaMaskEntriesPreTrig [16][3][6][2][3]
Int_t VaMaskChargePostTrig [16][3][6][2][3]
Int_t VaMaskRatePostTrig [16][3][6][2][3]
Int_t VaMaskEntriesPostTrig [16][3][6][2][3]
Int_t VaMaskRateSingles [16][3][6][2][3]
Int_t VaMaskMinSingles [16][3][6][2][3]
Int_t VaMaskMaxSingles [16][3][6][2][3]
Int_t VaMaskEntriesSingles [16][3][6][2][3]

Detailed Description

Definition at line 11 of file FarDetRawRateDump.h.


Constructor & Destructor Documentation

FarDetRawRateDump::FarDetRawRateDump (  ) 

Definition at line 27 of file FarDetRawRateDump.cxx.

00027                                      :
00028   fRawRateFile(0), 
00029   fRawRateTree(0),
00030   fTimeInterval(300)
00031 {
00032 
00033 }

FarDetRawRateDump::~FarDetRawRateDump (  ) 

Definition at line 35 of file FarDetRawRateDump.cxx.

00036 {
00037 
00038 }


Member Function Documentation

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

Implement this for read only access to the MomNavigator

Reimplemented from JobCModule.

Definition at line 176 of file FarDetRawRateDump.cxx.

References adc, RawLiTpmtDigitsBlock::At(), chargePostTrig, chargePreTrig, crate, date, deadchip, entriesPostTrig, entriesPreTrig, entriesSingles, MomNavigator::FragmentIter(), fRawRateFile, fRawRateTree, fTimeInterval, RawDigit::GetChannel(), RawChannelId::GetCrate(), RawDigitDataBlock::GetDatumIter(), RawLiTpmtDigitsBlock::GetNumberOfDigits(), RawTpSinglesSummaryBlock::GetRates(), RawSnarlHeaderBlock::GetRun(), RawDaqHeaderBlock::GetRun(), RawDaqHeaderBlock::GetTimeFrameNum(), RawSnarlHeaderBlock::GetTimeFrameNum(), RawDaqHeaderBlock::GetTimeStamp(), RawSnarlHeaderBlock::GetTriggerTime(), RawChannelId::GetVaAdcSel(), RawChannelId::GetVaChannel(), RawChannelId::GetVaChip(), RawChannelId::GetVarcId(), RawChannelId::GetVmm(), Msg::kDebug, Msg::kInfo, JobCResult::kPassed, LI, maxSingles, minSingles, MSG, n, nanosec, plane, PlnChMask, PlnMask, rate, ratePostTrig, ratePreTrig, rateSingles, run, shld, t, tdc, time, time0, timeframe, timeframenum, tnanosec, vaadc, VaCh2LiBox, VaCh2Shld, vachannel, vachip, VaMaskChargePostTrig, VaMaskChargePreTrig, VaMaskDead, VaMaskEntriesPostTrig, VaMaskEntriesPreTrig, VaMaskEntriesSingles, VaMaskLI, VaMaskMaxSingles, VaMaskMinSingles, VaMaskRatePostTrig, VaMaskRatePreTrig, VaMaskRateSingles, varc, and vmm.

00177 {
00178   MSG("FarDetRawRateDump",Msg::kDebug) << " *** FarDetRawRateDump::Ana(...) *** " << endl;
00179 
00180   JobCResult result(JobCResult::kPassed);
00181 
00182   TIter momitr(mom->FragmentIter());
00183   while(const RawRecord* rawrec = dynamic_cast<const RawRecord*>(momitr())){
00184   
00185     MSG("FarDetRawRateDump",Msg::kDebug) << "  *** NEXT RECORD ***  " << endl;  
00186 
00187     TIter rawrecitr = rawrec->GetRawBlockIter();
00188     TObject *tob;
00189     while((tob = rawrecitr())){
00190       MSG("FarDetRawRateDump",Msg::kDebug) << tob->GetName() << endl;
00191 
00192       if(tob->InheritsFrom("RawDaqHeaderBlock")){
00193         MSG("FarDetRawRateDump",Msg::kDebug) << " ... found RawDaqHeaderBlock " << endl;
00194         RawDaqHeaderBlock* rdb = (RawDaqHeaderBlock*)(tob);
00195         run = rdb->GetRun(); 
00196         timeframenum = rdb->GetTimeFrameNum(); 
00197         if(time0<0) time0=((VldTimeStamp)(rdb->GetTimeStamp())).GetSec();
00198         tnanosec=((VldTimeStamp)(rdb->GetTimeStamp())).GetNanoSec();
00199         MSG("FarDetRawRateDump",Msg::kDebug) << "   ... timeframe=" << timeframenum << endl; 
00200       }
00201 
00202       if(tob->InheritsFrom("RawSnarlHeaderBlock")){
00203         MSG("FarDetRawRateDump",Msg::kDebug) << " ... found RawSnarlHeaderBlock " << endl;
00204         RawSnarlHeaderBlock* rdb = (RawSnarlHeaderBlock*)(tob);
00205         run = rdb->GetRun(); 
00206         timeframenum = rdb->GetTimeFrameNum(); 
00207         if(time0<0) time0=((VldTimeStamp)(rdb->GetTriggerTime())).GetSec();
00208         tnanosec = ((VldTimeStamp)(rdb->GetTriggerTime())).GetNanoSec();
00209         MSG("FarDetRawRateDump",Msg::kDebug) << "   ... timeframe=" << timeframenum << endl; 
00210       }
00211 
00212       if(timeframe>=0 && !fRawRateFile){
00213         //TString mystring("./results/fardet.rate");
00214         //mystring.Append("."); mystring+=run; 
00215         //mystring.Append(".root");
00216         TString mystring("fardet.rate.root");
00217         TDirectory* tmpd = gDirectory;
00218         fRawRateFile = new TFile(mystring.Data(),"RECREATE");
00219         fRawRateTree = new TTree("RawRateTree","RawRateTree");
00220         fRawRateTree->SetAutoSave(100);
00221         fRawRateTree->Branch("run",&run,"run/I");
00222         fRawRateTree->Branch("crate",&crate,"crate/I");
00223         fRawRateTree->Branch("varc",&varc,"varc/I");
00224         fRawRateTree->Branch("vmm",&vmm,"vmm/I");
00225         fRawRateTree->Branch("vaadc",&vaadc,"vaadc/I");
00226         fRawRateTree->Branch("vachip",&vachip,"vachip/I");
00227         fRawRateTree->Branch("plane",&plane,"plane/I");
00228         fRawRateTree->Branch("shld",&shld,"shld/I");
00229         fRawRateTree->Branch("timeframe",&timeframe,"timeframe/I");
00230         fRawRateTree->Branch("time",&time,"time/I");
00231         fRawRateTree->Branch("date",&date,"date/I");
00232         fRawRateTree->Branch("chargePreTrig",&chargePreTrig,"chargePreTrig/I");
00233         fRawRateTree->Branch("ratePreTrig",&ratePreTrig,"ratePreTrig/I");
00234         fRawRateTree->Branch("entriesPreTrig",&entriesPreTrig,"entriesPreTrig/I");
00235         fRawRateTree->Branch("chargePostTrig",&chargePostTrig,"chargePostTrig/I");
00236         fRawRateTree->Branch("ratePostTrig",&ratePostTrig,"ratePostTrig/I");
00237         fRawRateTree->Branch("entriesPostTrig",&entriesPostTrig,"entriesPostTrig/I");
00238         fRawRateTree->Branch("rateSingles",&rateSingles,"rateSingles/I");
00239         fRawRateTree->Branch("maxSingles",&maxSingles,"maxSingles/I");
00240         fRawRateTree->Branch("minSingles",&minSingles,"minSingles/I");
00241         fRawRateTree->Branch("entriesSingles",&entriesSingles,"entriesSingles/I");
00242         fRawRateTree->Branch("deadchip",&deadchip,"deadchip/I");
00243         fRawRateTree->Branch("LI",&LI,"LI/I");
00244         gDirectory = tmpd; 
00245       }
00246 
00247       if(timeframe<0||timeframenum>=timeframe+fTimeInterval){
00248         MSG("FarDetRawRateDump",Msg::kDebug) << " ADDING ENTRY FOR TIME = " << time << endl;
00249         if(timeframe>=0 && fRawRateFile){
00250           for(crate=0;crate<16;crate++){
00251             for(varc=0;varc<3;varc++){
00252               for(vmm=0;vmm<6;vmm++){
00253                 for(vaadc=0;vaadc<2;vaadc++){
00254                   for(vachip=0;vachip<3;vachip++){
00255                     
00256                     chargePreTrig=0; ratePreTrig=0; entriesPreTrig=0;
00257                     chargePostTrig=0; ratePostTrig=0; entriesPostTrig=0;
00258                     rateSingles=0; maxSingles=0; minSingles=0; entriesSingles=0;
00259                     deadchip=0; LI=0;
00260 
00261                     vachannel=0; plane=-1; shld=-1;
00262                     plane=PlnMask[crate][6*varc+vmm]+vaadc;  
00263                     if(plane>=1&&(vachip==1||(vachip==2&&PlnChMask[vachannel]==1))) plane+=2;
00264                     if(plane<-1) shld=VaCh2Shld[crate][3*vaadc+vachip];
00265                     if( plane>0||shld>0 ){
00266                       entriesPreTrig=VaMaskEntriesPreTrig[crate][varc][vmm][vaadc][vachip];
00267                       ratePreTrig=VaMaskRatePreTrig[crate][varc][vmm][vaadc][vachip];
00268                       if(VaMaskRatePreTrig[crate][varc][vmm][vaadc][vachip]>0){
00269                         chargePreTrig=(Int_t)((Double_t)VaMaskChargePreTrig[crate][varc][vmm][vaadc][vachip]/(Double_t)VaMaskRatePreTrig[crate][varc][vmm][vaadc][vachip]);
00270                       }
00271 
00272                       entriesPostTrig=VaMaskEntriesPostTrig[crate][varc][vmm][vaadc][vachip];
00273                       ratePostTrig=VaMaskRatePostTrig[crate][varc][vmm][vaadc][vachip];
00274                       if(VaMaskRatePostTrig[crate][varc][vmm][vaadc][vachip]>0){
00275                         chargePostTrig=(Int_t)((Double_t)VaMaskChargePostTrig[crate][varc][vmm][vaadc][vachip]/(Double_t)VaMaskRatePostTrig[crate][varc][vmm][vaadc][vachip]);
00276                       }
00277 
00278                       entriesSingles=VaMaskEntriesSingles[crate][varc][vmm][vaadc][vachip];
00279                       maxSingles=VaMaskMaxSingles[crate][varc][vmm][vaadc][vachip];
00280                       minSingles=VaMaskMinSingles[crate][varc][vmm][vaadc][vachip];
00281                       if(VaMaskEntriesSingles[crate][varc][vmm][vaadc][vachip]>0){
00282                         rateSingles=(Int_t)((Double_t)VaMaskRateSingles[crate][varc][vmm][vaadc][vachip]/(Double_t)VaMaskEntriesSingles[crate][varc][vmm][vaadc][vachip]);
00283                       }
00284                       deadchip=VaMaskDead[crate][varc][vmm][vaadc][vachip];
00285                       LI=VaMaskLI[crate][varc][vmm][vaadc][vachip];
00286 
00287                       TDirectory* tmpd = gDirectory;
00288                       fRawRateFile->cd();
00289                       fRawRateTree->Fill();  
00290                       gDirectory = tmpd;
00291                     }
00292                   }
00293                 }
00294               }
00295             }
00296           }
00297           MSG("FarDetRawRateDump",Msg::kInfo) << " *** " << timeframe << " seconds *** " << endl;
00298         }
00299         for(crate=0;crate<16;crate++){
00300           for(varc=0;varc<3;varc++){
00301             for(vmm=0;vmm<6;vmm++){
00302               for(vaadc=0;vaadc<2;vaadc++){
00303                 for(vachip=0;vachip<3;vachip++){
00304                   VaMaskDead[crate][varc][vmm][vaadc][vachip]=0;
00305                   VaMaskLI[crate][varc][vmm][vaadc][vachip]=0;
00306 
00307                   VaMaskChargePreTrig[crate][varc][vmm][vaadc][vachip]=0;
00308                   VaMaskRatePreTrig[crate][varc][vmm][vaadc][vachip]=0; 
00309                   VaMaskEntriesPreTrig[crate][varc][vmm][vaadc][vachip]=0;
00310 
00311                   VaMaskChargePostTrig[crate][varc][vmm][vaadc][vachip]=0;
00312                   VaMaskRatePostTrig[crate][varc][vmm][vaadc][vachip]=0; 
00313                   VaMaskEntriesPostTrig[crate][varc][vmm][vaadc][vachip]=0;
00314 
00315                   VaMaskRateSingles[crate][varc][vmm][vaadc][vachip]=0; 
00316                   VaMaskMaxSingles[crate][varc][vmm][vaadc][vachip]=-1; 
00317                   VaMaskMinSingles[crate][varc][vmm][vaadc][vachip]=-1; 
00318                   VaMaskEntriesSingles[crate][varc][vmm][vaadc][vachip]=0; 
00319                 }
00320               }
00321             }
00322           }
00323         }
00324         timeframe=timeframenum; 
00325         date=(time0+timeframe-1059696000)/(3600*24);
00326         time=(time0+timeframe-1059696000)%(3600*24);
00327       }
00328 
00329       if(tob->InheritsFrom("RawTpSinglesSummaryBlock")){
00330         MSG("FarDetRawRateDump",Msg::kDebug) << " ... found RawTpSinglesSummaryBlock " << endl;  
00331         RawTpSinglesSummaryBlock* rdb = (RawTpSinglesSummaryBlock*)(tob);
00332         typedef std::map<RawChannelId,UInt_t> RCIdToRateMap;
00333         const RCIdToRateMap& rates = rdb->GetRates();  
00334         RCIdToRateMap::const_iterator rateItr = rates.begin();
00335         RCIdToRateMap::const_iterator rateEnd = rates.end();
00336         while ( rateItr != rateEnd ) {
00337           RawChannelId rawch = rateItr->first;
00338           rate = rateItr->second;
00339           crate = rawch.GetCrate();
00340           varc = rawch.GetVarcId();
00341           vmm = rawch.GetVmm();
00342           vaadc = rawch.GetVaAdcSel();
00343           vachip = rawch.GetVaChip();
00344           if(crate<16 && varc<3 && vmm<6 && vaadc<2 && vachip<3){   
00345             if(rate>50){
00346               VaMaskRateSingles[crate][varc][vmm][vaadc][vachip]+=rate;     
00347             }
00348             else{
00349               VaMaskDead[crate][varc][vmm][vaadc][vachip]=1; 
00350             }
00351             if( VaMaskMinSingles[crate][varc][vmm][vaadc][vachip]<0
00352              || rate<VaMaskMinSingles[crate][varc][vmm][vaadc][vachip] ){
00353               VaMaskMinSingles[crate][varc][vmm][vaadc][vachip]=rate;
00354             }
00355             if( VaMaskMaxSingles[crate][varc][vmm][vaadc][vachip]<0
00356              || rate>VaMaskMaxSingles[crate][varc][vmm][vaadc][vachip] ){
00357               VaMaskMaxSingles[crate][varc][vmm][vaadc][vachip]=rate;
00358             }
00359             VaMaskEntriesSingles[crate][varc][vmm][vaadc][vachip]+=1; 
00360           }
00361           rateItr++;
00362         }
00363       }
00364  
00365       if(tob->InheritsFrom("RawDigitDataBlock")){
00366         MSG("FarDetRawRateDump",Msg::kDebug) << " ... found RawDigitDataBlock " << endl;
00367         RawDigitDataBlock* rdb = (RawDigitDataBlock*)(tob);
00368 
00369         TIter digitr = rdb->GetDatumIter();
00370         while(RawDigit *rd = (RawDigit*)(digitr())){
00371           if(rd){
00372             RawChannelId rawch = (RawChannelId)(rd->GetChannel());
00373             adc = rd->GetADC();
00374             tdc = rd->GetTDC();
00375             t = 1.5625*tdc;
00376             nanosec = t - tnanosec;
00377             crate = rawch.GetCrate();
00378             varc = rawch.GetVarcId();
00379             vmm = rawch.GetVmm();
00380             vaadc = rawch.GetVaAdcSel();
00381             vachip = rawch.GetVaChip();
00382             if(nanosec<-150){
00383               VaMaskChargePreTrig[crate][varc][vmm][vaadc][vachip]+=adc;     
00384               VaMaskRatePreTrig[crate][varc][vmm][vaadc][vachip]+=1; 
00385             }
00386             else{
00387               VaMaskChargePostTrig[crate][varc][vmm][vaadc][vachip]+=adc;     
00388               VaMaskRatePostTrig[crate][varc][vmm][vaadc][vachip]+=1;       
00389             }
00390           }
00391         }
00392       
00393         for(crate=0;crate<16;crate++){
00394           for(varc=0;varc<3;varc++){
00395             for(vmm=0;vmm<6;vmm++){
00396               for(vaadc=0;vaadc<2;vaadc++){
00397                 for(vachip=0;vachip<3;vachip++){       
00398                   VaMaskEntriesPreTrig[crate][varc][vmm][vaadc][vachip]+=1;
00399                   VaMaskEntriesPostTrig[crate][varc][vmm][vaadc][vachip]+=1;
00400                 }
00401               }
00402             }
00403           }
00404         } 
00405       }
00406 
00407       if(tob->InheritsFrom("RawLiTpmtDigitsBlock")){
00408         MSG("FarDetRawRateDump",Msg::kDebug) << " ... found RawLiTpmtDigitsBlock " << endl; 
00409         RawLiTpmtDigitsBlock* rdb = (RawLiTpmtDigitsBlock*)(tob);
00410         Int_t ndigits = rdb->GetNumberOfDigits();
00411         for(Int_t n=0;n<ndigits;n++){
00412           RawDigit* rd = (RawDigit*)(rdb->At(n));
00413           if(rd){
00414             RawChannelId rawch = (RawChannelId)(rd->GetChannel());
00415             
00416             crate = rawch.GetCrate();
00417             varc = rawch.GetVarcId();
00418             vmm = rawch.GetVmm();
00419             vaadc = rawch.GetVaAdcSel();
00420             vachip = rawch.GetVaChip();
00421             vachannel = rawch.GetVaChannel();
00422             LI = 2*(VaCh2LiBox[vachannel]/2); 
00423 
00424             if(LI>=0 && LI<16){
00425               for(crate=LI;crate<=LI+1;crate++){
00426                 for(varc=0;varc<3;varc++){
00427                   for(vmm=0;vmm<6;vmm++){
00428                     for(vaadc=0;vaadc<2;vaadc++){
00429                       for(vachip=0;vachip<3;vachip++){       
00430                         VaMaskLI[crate][varc][vmm][vaadc][vachip]=1;
00431                       }
00432                     }
00433                   }
00434                 }
00435               }
00436             }
00437 
00438           }
00439         }
00440       }
00441 
00442     }
00443   }
00444   
00445   
00446   MSG("FarDetRawRateDump",Msg::kDebug) << " *** FarDetRawRateDump::Ana( ) FINISHED *** " << endl;
00447 
00448   return result;
00449 
00450 }

void FarDetRawRateDump::BeginJob ( void   )  [virtual]

Implement for notification of begin of job

Reimplemented from JobCModule.

Definition at line 40 of file FarDetRawRateDump.cxx.

References fTimeInterval, Msg::kInfo, MSG, PlnChMask, PlnMask, run, time0, timeframe, VaCh2LiBox, and VaCh2Shld.

00041 {
00042   MSG("FarDetRawRateDump",Msg::kInfo) << " *** FarDetRawRateDump::BeginJob() *** " << endl;
00043 
00044   Int_t i,j;
00045 
00046   Int_t tmpPlnMask[16][24]={
00047    { 1, 5, 9, 13, 17, -1, 
00048     21, 25, 29, 33, 37, 41, 
00049     45, 49, 53, 57, 61, -999, 
00050     -1, -1, -1, -1, -1, -1 },
00051    { 45, 49, 53, 57, 61, -999, 
00052     21, 25, 29, 33, 37, 41, 
00053     1, 5, 9, 13, 17, -1, 
00054     -1, -1, -1, -1, -1, -1 },
00055    { 65, 69, 73, 77, 81, -1, 
00056     85, 89, 93, 97, 101, 105, 
00057     109, 113, 117, 121, 125, -999, 
00058     -1, -1, -1, -1, -1, -1 },
00059    { 109, 113, 117, 121, 125, -999, 
00060     85, 89, 93, 97, 101, 105, 
00061     65, 69, 73, 77, 81, -1, 
00062     -1, -1, -1, -1, -1, -1 },
00063    { 129, 133, 137, 141, 145, -1, 
00064     149, 153, 157, 161, 165, 169, 
00065     173, 177, 181, 185, 189, -999, 
00066     -1, -1, -1, -1, -1, -1 },
00067    { 173, 177, 181, 185, 189, -999, 
00068     149, 153, 157, 161, 165, 169, 
00069     129, 133, 137, 141, 145, -1, 
00070     -1, -1, -1, -1, -1, -1 },
00071    { 193, 197, 201, 205, 209, -1, 
00072     213, 217, 221, 225, 229, -1, 
00073     233, 237, 241, 245, -1, -999, 
00074     -1, -1, -1, -1, -1, -1 },
00075    { 233, 237, 241, 245, -1, -999, 
00076     213, 217, 221, 225, 229, -1, 
00077     193, 197, 201, 205, 209, -1, 
00078     -1, -1, -1, -1, -1, -1 },
00079    { 250, 254, 258, 262, 266, -999, 
00080     270, 274, 278, 282, 286, 290, 
00081     294, 298, 302, 306, 310, -1, 
00082     -1, -1, -1, -1, -1, -1 },
00083    { 294, 298, 302, 306, 310, -1, 
00084     270, 274, 278, 282, 286, 290, 
00085     250, 254, 258, 262, 266, -999, 
00086     -1, -1, -1, -1, -1, -1 },
00087    { 314, 318, 322, 326, 330, -1, 
00088     334, 338, 342, 346, 350, 354, 
00089     358, 362, 366, 370, 374, -999, 
00090     -1, -1, -1, -1, -1, -1 },
00091    { 358, 362, 366, 370, 374, -1, 
00092     334, 338, 342, 346, 350, 354, 
00093     314, 318, 322, 326, 330, -999, 
00094     -1, -1, -1, -1, -1, -1 },
00095    { 378, 382, 386, 390, 394, -1, 
00096     398, 402, 406, 410, 414, 418, 
00097     422, 426, 430, 434, 438, -999, 
00098     -1, -1, -1, -1, -1, -1 },
00099    { 422, 426, 430, 434, 438, -1, 
00100     398, 402, 406, 410, 414, 418, 
00101     378, 382, 386, 390, 394, -999, 
00102     -1, -1, -1, -1, -1, -1 },
00103    { 442, 446, 450, 454, 458, -999, 
00104     462, 466, 470, 474, 478, 482, 
00105     -1, -1, -1, -1, -1, -1, 
00106     -1, -1, -1, -1, -1, -1 },
00107    { -1, -1, -1, -1, -1, -1, 
00108     462, 466, 470, 474, 478, 482, 
00109     442, 446, 450, 454, 458, -999, 
00110     -1, -1, -1, -1, -1, -1 },
00111   };
00112 
00113   for(i=0;i<16;i++){
00114     for(j=0;j<24;j++){
00115       PlnMask[i][j]=tmpPlnMask[i][j];
00116     }
00117   }
00118 
00119   Int_t tmpPlnChMask[22]={
00120     0, 0,
00121     1, 0, 1, 0,
00122     1, 0, 1, 0,
00123     0, 1, 0, 1,
00124     0, 1, 0, 1,
00125     0, 0, 0, 0 
00126   };
00127 
00128   for(i=0;i<22;i++){
00129     PlnChMask[i]=tmpPlnChMask[i];
00130   }
00131 
00132   Int_t tmpVaCh2Shld[16][6]={
00133     { 12,-1,-1,10,11,11 },
00134     { 12,-1,-1,10,11,11 },
00135     { 22,-1,-1,20,21,21 },
00136     { 22,-1,-1,20,21,21 },
00137     { 12,-1,-1,10,11,11 },
00138     { 12,-1,-1,10,11,11 },
00139     { 22,-1,-1,20,21,21 },
00140     { 22,-1,-1,20,21,21 },
00141     { 32,-1,-1,30,31,31 },
00142     { 32,-1,-1,30,31,31 },
00143     { 40,41,41,42,-1,-1 },
00144     { 40,41,41,42,-1,-1 },
00145     { 32,-1,-1,30,31,31 },
00146     { 32,-1,-1,30,31,31 },
00147     { 40,41,41,42,-1,-1 },
00148     { 40,41,41,42,-1,-1 },
00149   };
00150 
00151   for(i=0;i<16;i++){
00152     for(j=0;j<6;j++){
00153       VaCh2Shld[i][j]=tmpVaCh2Shld[i][j];
00154     }
00155   }
00156 
00157   Int_t tmpVaCh2LiBox[22]={
00158     -1, -1,
00159     14, 1, 7, 8,
00160     4, 10, 13, 3,
00161     11, 5, 2, 12,
00162     0, 6, 9, 15,
00163     -1, -1, -1, -1 
00164   };
00165 
00166   for(i=0;i<22;i++){
00167     VaCh2LiBox[i]=tmpVaCh2LiBox[i];
00168   }
00169 
00170   run=-1; timeframe=-1; time0=-1; 
00171 
00172   if(fTimeInterval<1) fTimeInterval=1; if(fTimeInterval>1000) fTimeInterval=1000;
00173 
00174 }

void FarDetRawRateDump::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 468 of file FarDetRawRateDump.cxx.

References fTimeInterval, Registry::Get(), Msg::kInfo, and MSG.

00469 {
00470 
00471   MSG("FarDetRawRateDump", Msg::kInfo) << " *** FarDetRawRateDump::Config() *** " << endl;
00472 
00473   Int_t tmpint;
00474   if(r.Get("TimeInterval",tmpint)) fTimeInterval = tmpint;
00475   MSG("FarDetRawRateDump", Msg::kInfo) << " *** TimeInterval = " << fTimeInterval << " *** " << endl;
00476 
00477   return;
00478 }

const Registry & FarDetRawRateDump::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 452 of file FarDetRawRateDump.cxx.

References fTimeInterval, Msg::kInfo, Registry::LockValues(), MSG, Registry::Set(), and Registry::UnLockValues().

00453 {
00454 
00455   MSG("FarDetRawRateDump", Msg::kInfo) << " *** FarDetRawRateDump::DefaultConfig() *** " << 
00456 endl;
00457 
00458   static Registry r;
00459   r.SetName("FarDetRawRateDump.config.default");
00460   r.UnLockValues();
00461   r.Set("TimeInterval",fTimeInterval);
00462   r.LockValues();
00463    MSG("FarDetRawRateDump", Msg::kInfo) << " *** TimeInterval = " << fTimeInterval << " *** " << endl;
00464   
00465   return r;
00466 }

void FarDetRawRateDump::EndJob (  )  [virtual]

Implement for notification of end of job

Reimplemented from JobCModule.

Definition at line 480 of file FarDetRawRateDump.cxx.

References fRawRateFile, fRawRateTree, Msg::kInfo, MSG, and PrintRunSummary().

00481 {
00482   MSG("FarDetRawRateDump",Msg::kInfo) << " *** FarDetRawRateDump::EndJob() *** " << endl;
00483   if(fRawRateFile){
00484     this->PrintRunSummary();  
00485     MSG("FarDetRawRateDump",Msg::kInfo) << " *** saving data to file *** " << endl;
00486     TDirectory* tmpddd = gDirectory;
00487     fRawRateFile->cd();
00488     fRawRateTree->Write();
00489     fRawRateFile->Close();
00490     gDirectory = tmpddd;
00491     MSG("FarDetRawRateDump",Msg::kInfo) << " *** data saved to file *** " << endl;
00492   }
00493 }

void FarDetRawRateDump::PrintRunSummary (  )  [private]

Definition at line 495 of file FarDetRawRateDump.cxx.

References chargePostTrig, chargePreTrig, crate, date, deadchip, entriesPostTrig, entriesPreTrig, entriesSingles, fRawRateFile, fRawRateTree, Msg::kInfo, LI, maxSingles, minSingles, MSG, plane, ratePostTrig, ratePreTrig, rateSingles, run, shld, time, timeframe, vaadc, vachip, varc, and vmm.

Referenced by EndJob().

00496 {
00497   MSG("FarDetRawRateDump",Msg::kInfo) << " *** FarDetRawRateDump::PrintRunSummary() *** " << endl;
00498  
00499   if(fRawRateFile){
00500     fRawRateTree->SetBranchAddress("run",&run);
00501     fRawRateTree->SetBranchAddress("crate",&crate);
00502     fRawRateTree->SetBranchAddress("varc",&varc);
00503     fRawRateTree->SetBranchAddress("vmm",&vmm);
00504     fRawRateTree->SetBranchAddress("vaadc",&vaadc);
00505     fRawRateTree->SetBranchAddress("vachip",&vachip);
00506     fRawRateTree->SetBranchAddress("plane",&plane);
00507     fRawRateTree->SetBranchAddress("shld",&shld);
00508     fRawRateTree->SetBranchAddress("timeframe",&timeframe);
00509     fRawRateTree->SetBranchAddress("time",&time);
00510     fRawRateTree->SetBranchAddress("date",&date);
00511     fRawRateTree->SetBranchAddress("chargePreTrig",&chargePreTrig);
00512     fRawRateTree->SetBranchAddress("ratePreTrig",&ratePreTrig);
00513     fRawRateTree->SetBranchAddress("entriesPreTrig",&entriesPreTrig);
00514     fRawRateTree->SetBranchAddress("chargePostTrig",&chargePostTrig);
00515     fRawRateTree->SetBranchAddress("ratePostTrig",&ratePostTrig);
00516     fRawRateTree->SetBranchAddress("entriesPostTrig",&entriesPostTrig);
00517     fRawRateTree->SetBranchAddress("rateSingles",&rateSingles);
00518     fRawRateTree->SetBranchAddress("maxSingles",&maxSingles);
00519     fRawRateTree->SetBranchAddress("minSingles",&minSingles);
00520     fRawRateTree->SetBranchAddress("entriesSingles",&entriesSingles);
00521     fRawRateTree->SetBranchAddress("deadchip",&deadchip);
00522     fRawRateTree->SetBranchAddress("LI",&LI);
00523      
00524 
00525     Int_t myrun=-1;
00526     Int_t DeadChipCtr[16][3][6][2][3];
00527 
00528     for(crate=0;crate<16;crate++){
00529       for(varc=0;varc<3;varc++){
00530         for(vmm=0;vmm<6;vmm++){
00531           for(vaadc=0;vaadc<2;vaadc++){
00532             for(vachip=0;vachip<3;vachip++){
00533               DeadChipCtr[crate][varc][vmm][vaadc][vachip]=0;
00534             }
00535           }
00536         }
00537       }
00538     }
00539 
00540     for(Int_t i=0;i<fRawRateTree->GetEntries();i++){
00541       fRawRateTree->GetEntry(i);
00542       if( plane>=0 || shld>=0 ){
00543        
00544         if( deadchip>0 ){
00545           DeadChipCtr[crate][varc][vmm][vaadc][vachip]=1;
00546         }
00547 
00548       }
00549       if(myrun<0&&run>0) myrun=run;
00550     }
00551 
00552     MSG("FarDetRawRateDump",Msg::kInfo) << " *** List of Bad Chips ( Run=" << myrun << " ) *** " << endl;
00553     for(crate=0;crate<16;crate++){
00554       for(varc=0;varc<3;varc++){
00555         for(vmm=0;vmm<6;vmm++){
00556           for(vaadc=0;vaadc<2;vaadc++){
00557             for(vachip=0;vachip<3;vachip++){
00558 
00559               if( DeadChipCtr[crate][varc][vmm][vaadc][vachip]==1 ){
00560                 MSG("FarDetRawRateDump",Msg::kInfo) << crate << "-" << varc << "-" << vmm << "-" << vaadc << "-" << vachip << " (dead) " << endl;
00561               }
00562 
00563             }
00564           }
00565         }
00566       }
00567     }
00568 
00569   }
00570 }


Member Data Documentation

Int_t FarDetRawRateDump::adc [private]

Definition at line 39 of file FarDetRawRateDump.h.

Referenced by Ana().

Definition at line 32 of file FarDetRawRateDump.h.

Referenced by Ana(), and PrintRunSummary().

Definition at line 31 of file FarDetRawRateDump.h.

Referenced by Ana(), and PrintRunSummary().

Int_t FarDetRawRateDump::crate [private]

Definition at line 35 of file FarDetRawRateDump.h.

Referenced by Ana(), and PrintRunSummary().

Int_t FarDetRawRateDump::date [private]

Definition at line 30 of file FarDetRawRateDump.h.

Referenced by Ana(), and PrintRunSummary().

Int_t FarDetRawRateDump::deadchip [private]

Definition at line 30 of file FarDetRawRateDump.h.

Referenced by Ana(), and PrintRunSummary().

Definition at line 32 of file FarDetRawRateDump.h.

Referenced by Ana(), and PrintRunSummary().

Definition at line 31 of file FarDetRawRateDump.h.

Referenced by Ana(), and PrintRunSummary().

Definition at line 33 of file FarDetRawRateDump.h.

Referenced by Ana(), and PrintRunSummary().

Int_t FarDetRawRateDump::flag [private]

Definition at line 36 of file FarDetRawRateDump.h.

Definition at line 25 of file FarDetRawRateDump.h.

Referenced by Ana(), EndJob(), and PrintRunSummary().

Definition at line 26 of file FarDetRawRateDump.h.

Referenced by Ana(), EndJob(), and PrintRunSummary().

Definition at line 27 of file FarDetRawRateDump.h.

Referenced by Ana(), BeginJob(), Config(), and DefaultConfig().

Int_t FarDetRawRateDump::LI [private]

Definition at line 30 of file FarDetRawRateDump.h.

Referenced by Ana(), and PrintRunSummary().

Definition at line 34 of file FarDetRawRateDump.h.

Referenced by Ana(), and PrintRunSummary().

Definition at line 34 of file FarDetRawRateDump.h.

Referenced by Ana(), and PrintRunSummary().

Double_t FarDetRawRateDump::nanosec [private]

Definition at line 38 of file FarDetRawRateDump.h.

Referenced by Ana().

Int_t FarDetRawRateDump::plane [private]

Definition at line 36 of file FarDetRawRateDump.h.

Referenced by Ana(), and PrintRunSummary().

Int_t FarDetRawRateDump::PlnChMask[22] [private]

Definition at line 42 of file FarDetRawRateDump.h.

Referenced by Ana(), and BeginJob().

Int_t FarDetRawRateDump::PlnMask[16][24] [private]

Definition at line 41 of file FarDetRawRateDump.h.

Referenced by Ana(), and BeginJob().

Int_t FarDetRawRateDump::rate [private]

Definition at line 30 of file FarDetRawRateDump.h.

Referenced by Ana().

Definition at line 32 of file FarDetRawRateDump.h.

Referenced by Ana(), and PrintRunSummary().

Definition at line 31 of file FarDetRawRateDump.h.

Referenced by Ana(), and PrintRunSummary().

Definition at line 33 of file FarDetRawRateDump.h.

Referenced by Ana(), and PrintRunSummary().

Int_t FarDetRawRateDump::run [private]

Definition at line 29 of file FarDetRawRateDump.h.

Referenced by Ana(), BeginJob(), and PrintRunSummary().

Int_t FarDetRawRateDump::shld [private]

Definition at line 36 of file FarDetRawRateDump.h.

Referenced by Ana(), and PrintRunSummary().

Double_t FarDetRawRateDump::t [private]

Definition at line 38 of file FarDetRawRateDump.h.

Referenced by Ana().

Int_t FarDetRawRateDump::tdc [private]

Definition at line 39 of file FarDetRawRateDump.h.

Referenced by Ana().

Int_t FarDetRawRateDump::time [private]

Definition at line 30 of file FarDetRawRateDump.h.

Referenced by Ana(), and PrintRunSummary().

Int_t FarDetRawRateDump::time0 [private]

Definition at line 37 of file FarDetRawRateDump.h.

Referenced by Ana(), and BeginJob().

Definition at line 37 of file FarDetRawRateDump.h.

Referenced by Ana(), BeginJob(), and PrintRunSummary().

Definition at line 37 of file FarDetRawRateDump.h.

Referenced by Ana().

Double_t FarDetRawRateDump::tnanosec [private]

Definition at line 38 of file FarDetRawRateDump.h.

Referenced by Ana().

Int_t FarDetRawRateDump::vaadc [private]

Definition at line 35 of file FarDetRawRateDump.h.

Referenced by Ana(), and PrintRunSummary().

Int_t FarDetRawRateDump::VaCh2LiBox[22] [private]

Definition at line 44 of file FarDetRawRateDump.h.

Referenced by Ana(), and BeginJob().

Int_t FarDetRawRateDump::VaCh2Shld[16][6] [private]

Definition at line 43 of file FarDetRawRateDump.h.

Referenced by Ana(), and BeginJob().

Definition at line 35 of file FarDetRawRateDump.h.

Referenced by Ana().

Int_t FarDetRawRateDump::vachip [private]

Definition at line 35 of file FarDetRawRateDump.h.

Referenced by Ana(), and PrintRunSummary().

Int_t FarDetRawRateDump::VaMaskChargePostTrig[16][3][6][2][3] [private]

Definition at line 53 of file FarDetRawRateDump.h.

Referenced by Ana().

Int_t FarDetRawRateDump::VaMaskChargePreTrig[16][3][6][2][3] [private]

Definition at line 49 of file FarDetRawRateDump.h.

Referenced by Ana().

Int_t FarDetRawRateDump::VaMaskDead[16][3][6][2][3] [private]

Definition at line 46 of file FarDetRawRateDump.h.

Referenced by Ana().

Int_t FarDetRawRateDump::VaMaskEntriesPostTrig[16][3][6][2][3] [private]

Definition at line 55 of file FarDetRawRateDump.h.

Referenced by Ana().

Int_t FarDetRawRateDump::VaMaskEntriesPreTrig[16][3][6][2][3] [private]

Definition at line 51 of file FarDetRawRateDump.h.

Referenced by Ana().

Int_t FarDetRawRateDump::VaMaskEntriesSingles[16][3][6][2][3] [private]

Definition at line 60 of file FarDetRawRateDump.h.

Referenced by Ana().

Int_t FarDetRawRateDump::VaMaskLI[16][3][6][2][3] [private]

Definition at line 47 of file FarDetRawRateDump.h.

Referenced by Ana().

Int_t FarDetRawRateDump::VaMaskMaxSingles[16][3][6][2][3] [private]

Definition at line 59 of file FarDetRawRateDump.h.

Referenced by Ana().

Int_t FarDetRawRateDump::VaMaskMinSingles[16][3][6][2][3] [private]

Definition at line 58 of file FarDetRawRateDump.h.

Referenced by Ana().

Int_t FarDetRawRateDump::VaMaskRatePostTrig[16][3][6][2][3] [private]

Definition at line 54 of file FarDetRawRateDump.h.

Referenced by Ana().

Int_t FarDetRawRateDump::VaMaskRatePreTrig[16][3][6][2][3] [private]

Definition at line 50 of file FarDetRawRateDump.h.

Referenced by Ana().

Int_t FarDetRawRateDump::VaMaskRateSingles[16][3][6][2][3] [private]

Definition at line 57 of file FarDetRawRateDump.h.

Referenced by Ana().

Int_t FarDetRawRateDump::varc [private]

Definition at line 35 of file FarDetRawRateDump.h.

Referenced by Ana(), and PrintRunSummary().

Int_t FarDetRawRateDump::vmm [private]

Definition at line 35 of file FarDetRawRateDump.h.

Referenced by Ana(), and PrintRunSummary().


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

Generated on 22 Nov 2017 for loon by  doxygen 1.6.1