LISummaryModule Class Reference

#include <LISummaryModule.h>

Inheritance diagram for LISummaryModule:
JobCModule

List of all members.

Public Member Functions

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

Private Member Functions

JobCResult GetPulserBlocks (RawRecord *rawrec, MomNavigator *mom)
JobCResult GetSummaryBlocks (RawRecord *rawrec)
void PrintBlockInfo (string preString)

Private Attributes

Int_t calibPoint
Int_t calibType
Bool_t fDataReconstructed
LISummarySorter summarySorter
Int_t led
Int_t fLedLast
Int_t fLIRunSeqReq
Int_t fWriteOnlyGainCurves
Float_t mean
Int_t numEntries
Int_t period
Int_t pulseHeight
Int_t pulserBox
Int_t pulses
Int_t pulseWidth
Float_t rms
std::map< Int_t, Int_t > fLIRunSeqCurrent
Int_t timeNanoSec
Int_t timeSec
VldTimeStamp timeStamp
LILookup fLookup

Detailed Description

Definition at line 32 of file LISummaryModule.h.


Constructor & Destructor Documentation

LISummaryModule::LISummaryModule (  ) 

Definition at line 52 of file LISummaryModule.cxx.

References Msg::kDebug, and MSG.

00053 {
00054   MSG("LISummaryModule", Msg::kDebug) 
00055    <<"Running LISummaryModule constructor..."<<endl;
00056 
00057   //initialise data members
00058   calibPoint=-1;
00059   calibType=-1;
00060   fDataReconstructed=false;
00061   led=-1;
00062   fLedLast=-1;
00063   //don't need these two below, it is set in DefaultConfig
00064   //fLIRunSeqReq=1;//set to first run seq in long run by default
00065   //fWriteOnlyGainCurves=0;
00066   mean=-1;
00067   numEntries=-1;
00068   period=-1;
00069   pulseHeight=-1;
00070   pulserBox=-1;
00071   pulses=-1;
00072   pulseWidth=-1;
00073   rms=-1;
00074   timeNanoSec=-1; 
00075   timeSec=-1;
00076 
00077   MSG("LISummaryModule", Msg::kDebug) 
00078    <<"Finished constructor"<<endl;
00079 }

LISummaryModule::~LISummaryModule (  ) 

Definition at line 83 of file LISummaryModule.cxx.

References Msg::kDebug, and MSG.

00084 {
00085   MSG("LISummaryModule", Msg::kDebug) 
00086    <<"Running destructor..."<<endl;
00087 
00088   MSG("LISummaryModule", Msg::kDebug) 
00089    <<"Finished destructor"<<endl;
00090 }


Member Function Documentation

void LISummaryModule::BeginJob ( void   )  [virtual]

Implement for notification of begin of job

Reimplemented from JobCModule.

Definition at line 519 of file LISummaryModule.cxx.

References fLIRunSeqReq, Msg::kInfo, and MSG.

00520 {
00521   MSG("LISummaryModule",Msg::kInfo)
00522     <<endl
00523     <<"**********************************************************"<<endl
00524     <<"This code has a new feature. It can pluck out a particular"<<endl
00525     <<"LI run, e.g. when there are multiple drift points it only"<<endl
00526     <<"returns the one defined by fLIRunSeqReq"<<endl
00527     <<"Setting fLIRunSeqReq to be -1 writes out everything"<<endl
00528     <<"This variable is set in LIReco.C using LIRunSeqRequired"<<endl
00529     <<"Currently fLIRunSeqReq="<<fLIRunSeqReq<<endl
00530     <<"**********************************************************"
00531     <<endl<<endl;
00532 }

void LISummaryModule::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.

Purpose: Configure the module given a registry.

Reimplemented from JobCModule.

Definition at line 603 of file LISummaryModule.cxx.

References fLIRunSeqReq, fWriteOnlyGainCurves, Registry::Get(), Msg::kDebug, and MSG.

00604 {
00606 
00607   MSG("LISummaryModule", Msg::kDebug)<<"LISummaryModule::Config"<<endl;
00608 
00609   Int_t runSeqReq=-1;
00610   if (r.Get("LIRunSeqRequired",runSeqReq)) fLIRunSeqReq=runSeqReq;
00611 
00612   Int_t writeOnlyGainCurves=0;
00613   if (r.Get("WriteOnlyGainCurves",writeOnlyGainCurves)) fWriteOnlyGainCurves=
00614                                                           writeOnlyGainCurves;
00615 }

const Registry & LISummaryModule::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; }

Purpose: Method to return default configuration.

Reimplemented from JobCModule.

Definition at line 579 of file LISummaryModule.cxx.

References JobCModule::GetName(), Msg::kDebug, Registry::LockValues(), MSG, Registry::Set(), and Registry::UnLockValues().

00580 {
00582 
00583   MSG("LISummaryModule", Msg::kDebug)
00584     << "Running LISummaryModule::DefaultConfig..." << endl;
00585     
00586   static Registry r;
00587 
00588   string name=this->JobCModule::GetName();
00589   name+=".config.default";
00590   r.SetName(name.c_str());
00591   r.UnLockValues();
00592 
00593   r.Set("LIRunSeqRequired",-1);
00594   r.Set("WriteOnlyGainCurves",0);
00595 
00596   r.LockValues();
00597 
00598   return r;
00599 }

void LISummaryModule::EndJob (  )  [virtual]

Implement for notification of end of job

Reimplemented from JobCModule.

Definition at line 536 of file LISummaryModule.cxx.

References calibPoint, calibType, fDataReconstructed, Form(), led, LISummarySorter::OutputData(), period, LISummarySorter::PrintRecoSummary(), pulseHeight, pulserBox, pulses, pulseWidth, summarySorter, timeStamp, and LISummarySorter::Update().

00537 {  
00538   if (fDataReconstructed){
00539 
00540     //write out the profiles if they exist
00541     TObject* o=gROOT->FindObject("pSummarySizeVsTFAll");
00542     if (o) o->Write();
00543     o=gROOT->FindObject("pSummarySizeVsTF90");
00544     if (o) o->Write();
00545     o=gROOT->FindObject("pSummarySizeVsTF");
00546     if (o) o->Write();
00547     o=gROOT->FindObject("hSummarySize");
00548     if (o) o->Write();
00549     
00550     for (Int_t i=0;i<=150;i++){
00551       string s="pSummaryEntVsTF50Pl";
00552       s+=Form("%d",i);
00553       o=gROOT->FindObject(s.c_str());
00554       if (o) o->Write();
00555       //else {MAXMSG("LISummaryModule",Msg::kInfo,10)<<"Can't find object with name="<<s<<endl;}
00556       s="pSummaryEntVsTF90Pl";
00557       s+=Form("%d",i);
00558       o=gROOT->FindObject(s.c_str());
00559       if (o) o->Write();
00560       //else {MAXMSG("LISummaryModule",Msg::kInfo,10)<<"Can't find object with name="<<s<<endl;}
00561     }
00562 
00563     //add 10000 to led to trigger the writing to file of last data  
00564     //(and to make it obvious!)
00565     summarySorter.Update(led+10000,pulseHeight,pulseWidth,pulserBox,
00566                          calibPoint,timeStamp,calibType,pulses,period);
00567     summarySorter.PrintRecoSummary();
00568     //this has to be last
00569     summarySorter.OutputData();
00570   }
00571   else {
00572     //just print what was found (could just be no LI stream!)
00573     summarySorter.PrintRecoSummary();
00574   }
00575 }

JobCResult LISummaryModule::GetPulserBlocks ( RawRecord rawrec,
MomNavigator mom 
) [private]

Definition at line 147 of file LISummaryModule.cxx.

References LISummarySorter::AddEntry(), calibPoint, calibType, RawRecord::FindRawBlock(), PulserFromRawSummaryList::GetExpectedPoints(), MomNavigator::GetFragment(), PulserFromRawSummaryList::GetHeight(), PulserFromRawSummaryList::GetLed(), VldTimeStamp::GetNanoSec(), PulserFromRawSummaryList::GetNearBegin(), PulserFromRawSummaryList::GetNearEnd(), PulserFromRawSummaryList::GetNumPulses(), PulserFromRawSummaryList::GetPointIndex(), PulserFromRawSummaryList::GetPulserBox(), RawRecord::GetRawHeader(), RawDaqHeader::GetRun(), RawRunCommentBlock::GetRunComment(), RawDaqHeader::GetRunType(), VldTimeStamp::GetSec(), RawDaqHeader::GetSubRun(), VldContext::GetTimeStamp(), RecMinosHdr::GetVldContext(), PulserFromRawSummaryList::GetVldContext(), PulserFromRawSummaryList::GetWidth(), JobCResult::kFailed, Msg::kInfo, JobCResult::kPassed, Msg::kVerbose, led, mean, MSG, numEntries, period, pulseHeight, pulserBox, pulses, pulseWidth, rms, LISummarySorter::SetDetector(), LISummarySorter::SetPlexHandle(), LISummarySorter::SetRunNumber(), LISummarySorter::SetRunNumberSub(), LISummarySorter::SetRunType(), summarySorter, timeNanoSec, timeSec, timeStamp, and LISummarySorter::Update().

Referenced by Reco().

00149 {
00150   JobCResult result(JobCResult::kPassed);
00151 
00152   PulserFromRawSummaryList *psl = dynamic_cast
00153     <PulserFromRawSummaryList *>
00154     (mom->GetFragment("PulserFromRawSummaryList"));
00155   
00156   if (!psl) {
00157     MSG("LISummaryModule",Msg::kInfo) 
00158       <<"No pulser summary list here\n";
00159     return JobCResult::kFailed;
00160   }
00161 
00162   MSG("LISummaryModule",Msg::kInfo) 
00163     <<"Got pulser summary "<<psl->GetPointIndex()
00164     <<" of "<<psl->GetExpectedPoints()<<endl;
00165 
00166   //TIter itr = rawRec->GetRawBlockIter();
00167   //RawDataBlock* rawBlk;
00168 
00169   const RawRunCommentBlock* rrcb=dynamic_cast<const RawRunCommentBlock*>
00170     (rawrec->FindRawBlock("RawRunCommentBlock"));
00171   //<RawRunCommentBlock*>(rawBlk)
00172 
00173   //get LI Summary block from rawdatablock
00174   //  const RawLIAdcSummaryBlock *rawliadcsummaryblock = 
00175   // dynamic_cast<const RawLIAdcSummaryBlock*>
00176   //(rawrec->FindRawBlock("RawLIAdcSummaryBlock"));
00177 
00178 
00179   if(rrcb){
00180     //look at rawrunconfig block too
00181     MSG("LISummaryModule",Msg::kInfo) 
00182       << "------------------------------------------------" << endl
00183       << "COMMENT:" << endl
00184       << rrcb->GetRunComment() << endl
00185       << "------------------------------------------------" << endl;
00186   }
00187   else {
00188     MSG("LISummaryModule",Msg::kInfo) 
00189       <<"No raw run comment block in mom"<<endl;
00190   }
00191 
00192   VldContext vDaqHdr;
00193   //get raw header
00194   const RawDaqHeader *rawDaqHdr=
00195      dynamic_cast<const RawDaqHeader*>(rawrec->GetRawHeader());
00196   if (rawDaqHdr){
00197     summarySorter.SetRunNumber(rawDaqHdr->GetRun());
00198     summarySorter.SetRunNumberSub(rawDaqHdr->GetSubRun());
00199     summarySorter.SetRunType(rawDaqHdr->GetRunType());
00200     summarySorter.SetDetector(rawDaqHdr->GetVldContext());
00201     vDaqHdr=rawDaqHdr->GetVldContext();
00202     MSG("LISummaryModule", Msg::kVerbose) 
00203       <<"Time in raw daq header is: "<<vDaqHdr.GetTimeStamp()<<endl;
00204   }
00205 
00206   // Work through psl..  
00207   timeStamp=vDaqHdr.GetTimeStamp();
00208   timeSec=timeStamp.GetSec();
00209   timeNanoSec=timeStamp.GetNanoSec();
00210   calibPoint=psl->GetPointIndex();
00211   calibType=psl->GetExpectedPoints();
00212   pulserBox=psl->GetPulserBox();
00213   led=psl->GetLed();
00214   pulseHeight=psl->GetHeight();
00215   pulseWidth=psl->GetWidth();
00216   pulses=psl->GetNumPulses();
00217   period=10;//psl->GetPeriod();
00218     
00219   //set the plex handle with the current vld context
00220   summarySorter.SetPlexHandle(psl->GetVldContext());
00221   summarySorter.Update(led,pulseHeight,pulseWidth,pulserBox,calibPoint,
00222                        timeStamp,calibType,pulses,period);
00223   
00224   map<Int_t,PulserSummary>::const_iterator ps=psl->GetNearBegin();
00225 
00226   while (ps!=psl->GetNearEnd()){
00227     
00228     mean=(*ps).second.GetMean();
00229     rms=(*ps).second.GetRMS();
00230     numEntries=(*ps).second.GetEntries();
00231     
00232     UInt_t rawchannel=(*ps).second.GetChannel();
00233 
00234     summarySorter.AddEntry(rawchannel,mean,rms,numEntries);  
00235     //  cout<<(*ps).second.GetChannel().GetCrate()<<endl;
00236     ps++;
00237   }
00238   
00239   //summarySorter.CountNumSummaries(rawliadcsummaryblock->
00240   //                      GetNumberOfSummaries());
00241 
00242   //Work through all summaries
00243   //for(Int_t n=0;n<rawliadcsummaryblock->GetNumberOfSummaries();n++){
00244   //const RawLIAdcSummary *rawliadcsummary=
00245   //  rawliadcsummaryblock->At(n);
00246       
00247   //mean=rawliadcsummary->GetMean();
00248   //rms=rawliadcsummary->GetRms();
00249   //numEntries=rawliadcsummary->GetEntries();
00250       
00251   //summarySorter.AddEntry(rawliadcsummary->GetChannel(),
00252   //               mean,rms,numEntries);  
00253   //}
00254 
00255   return result;
00256 }

JobCResult LISummaryModule::GetSummaryBlocks ( RawRecord rawrec  )  [private]

Definition at line 260 of file LISummaryModule.cxx.

References LISummarySorter::AddEntry(), RawLIAdcSummaryBlock::At(), calibPoint, calibType, LISummarySorter::CountNumSummaries(), fDataReconstructed, RawRecord::FindRawBlock(), LILookup::FIRSTLED, LILookup::FIRSTPULSERBOX, fLIRunSeqCurrent, fLIRunSeqReq, fLookup, Form(), fWriteOnlyGainCurves, RawLIAdcSummaryBlock::GetCalibPoint(), RawLIAdcSummaryBlock::GetCalibType(), RawLIAdcSummary::GetChannel(), RawLIAdcSummary::GetEntries(), RawLIAdcSummaryBlock::GetLed(), RawLIAdcSummary::GetMean(), VldTimeStamp::GetNanoSec(), RawLIAdcSummaryBlock::GetNumberOfSummaries(), RawLIAdcSummaryBlock::GetPeriod(), VHS::GetPlane(), RawLIAdcSummaryBlock::GetPulseHeight(), RawLIAdcSummaryBlock::GetPulserBox(), RawLIAdcSummaryBlock::GetPulses(), RawLIAdcSummaryBlock::GetPulseWidth(), RawLIAdcSummary::GetRms(), VldTimeStamp::GetSec(), RawLIAdcSummaryBlock::GetTimeStamp(), RawLIAdcSummaryBlock::GetVldContext(), MsgService::Instance(), Msg::kDebug, Msg::kError, JobCResult::kFailed, Msg::kInfo, JobCResult::kPassed, Msg::kVerbose, Msg::kWarning, LILookup::LASTLED, LILookup::LASTPULSERBOX, led, MAXMSG, mean, MSG, n, numEntries, LILookup::NUMLEDS, period, PrintBlockInfo(), pulseHeight, pulserBox, pulses, pulseWidth, rms, JobCResult::SetError(), JobCResult::SetFailed(), LISummarySorter::SetPlexHandle(), summarySorter, timeNanoSec, timeSec, timeStamp, and LISummarySorter::Update().

Referenced by Reco().

00261 {
00262   JobCResult result(JobCResult::kPassed);
00263 
00264   //get LI Summary block from rawdatablock
00265   const RawLIAdcSummaryBlock *rawliadcsummaryblock = 
00266     dynamic_cast<const RawLIAdcSummaryBlock*>
00267     (rawrec->FindRawBlock("RawLIAdcSummaryBlock"));
00268   
00269   //check li block exists
00270   if(!rawliadcsummaryblock){  
00271     result.SetError().SetFailed();
00272     MSG("LISummaryModule",Msg::kError) 
00273       <<"No Raw LI Adc Summary Block in raw record"<<endl;
00274     return result;
00275   }
00276   
00277   //Work through rawliadcsummaryblock
00278   timeStamp=rawliadcsummaryblock->GetTimeStamp();
00279   timeSec=timeStamp.GetSec();
00280   timeNanoSec=timeStamp.GetNanoSec();
00281   calibPoint=rawliadcsummaryblock->GetCalibPoint();
00282   calibType=rawliadcsummaryblock->GetCalibType();
00283   pulserBox=rawliadcsummaryblock->GetPulserBox();
00284   led=rawliadcsummaryblock->GetLed();
00285   pulseHeight=rawliadcsummaryblock->GetPulseHeight();
00286   pulseWidth=rawliadcsummaryblock->GetPulseWidth();
00287   pulses=rawliadcsummaryblock->GetPulses();
00288   period=rawliadcsummaryblock->GetPeriod();
00289 
00290   //print out the current TF summary block info
00291   if (MsgService::Instance()->IsActive("LISummaryModule",
00292                                        Msg::kDebug)){
00293     this->PrintBlockInfo("LICollector: New Block ");
00294   }
00295 
00296 
00298   //Section to control which DPs (or GCs) are written to file
00300 
00301   //check if only GCs are requested
00302   if (fWriteOnlyGainCurves){
00303     MAXMSG("LISummaryModule",Msg::kInfo,1)
00304       <<"Only points with calibType>1 (i.e. GCs) will be written out"<<endl; 
00305     if (calibType==1){//then it's a drift point and you want to strip it out
00306 
00307       //only print out info if it's a new ledIndex
00308       Int_t ledIndex=pulserBox*fLookup.NUMLEDS+led;
00309       static Int_t lastLedIndex=-1;
00310       if (ledIndex!=lastLedIndex){
00311         MSG("LISummaryModule",Msg::kInfo) 
00312           <<"Only writing GCs, skipping drift point with settings:"<<endl;
00313         //print out the point that was rejected 
00314         //(before set to new values)
00315         this->PrintBlockInfo("  ");
00316       }
00317       lastLedIndex=ledIndex;
00318       return JobCResult::kFailed;
00319     }
00320     else{
00321       //just carry on
00322     }
00323   }
00324   else {
00325     MAXMSG("LISummaryModule",Msg::kInfo,1)
00326       <<"All calibTypes will be written out"<<endl; 
00327   }
00328   
00329   if (led>=fLookup.FIRSTLED && led<=fLookup.LASTLED && 
00330       pulserBox>=fLookup.FIRSTPULSERBOX &&
00331       pulserBox<=fLookup.LASTPULSERBOX){
00332     //add the ledIndex to the counter
00333     //but only if it's a new ledIndex (have to allow gain curves!)
00334     Int_t ledIndex=pulserBox*fLookup.NUMLEDS+led;
00335     static Int_t lastLedIndex=-1;//only assigned -1 on first call
00336     MSG("LISummaryModule",Msg::kVerbose) 
00337       <<"lastLedIndex="<<lastLedIndex<<endl;
00338     if (ledIndex!=lastLedIndex){
00339       fLIRunSeqCurrent[ledIndex]++;//this is a map so isn't ledIndex-1
00340     }
00341     
00342     //check which DP in a long run we want to write to the tree
00343     //if fLIRunSeqReq=-1 then write out everything
00344     if (fLIRunSeqCurrent[ledIndex]!=fLIRunSeqReq && fLIRunSeqReq!=-1){
00345       
00346       //only print out info if it's a new ledIndex
00347       if (ledIndex!=lastLedIndex){
00348         MSG("LISummaryModule",Msg::kInfo) 
00349           <<endl
00350           <<" ** Skipping point in this run, fLIRunSeqReq="
00351           <<fLIRunSeqReq
00352           <<", fLIRunSeqCurrent["<<ledIndex<<"]="
00353           <<fLIRunSeqCurrent[ledIndex]<<" **"
00354           <<endl;    
00355         //print out the point that was rejected 
00356         //(before set to new values)
00357         this->PrintBlockInfo("Point had settings: ");
00358       }
00359       lastLedIndex=ledIndex;
00360       
00361       return JobCResult::kFailed;
00362     }
00363     lastLedIndex=ledIndex;
00364   }
00365   else{
00366     static Int_t numberMsg=0;
00367     if (numberMsg<10){
00368       MSG("LISummaryModule",Msg::kWarning) 
00369         <<endl<<"Skipping summary block with strange values:"<<endl;
00370       this->PrintBlockInfo("");
00371       if (numberMsg==9){
00372         MSG("LISummarySorter",Msg::kWarning) 
00373           <<endl
00374           <<"This is the last message of this type to be printed"
00375           <<endl;
00376       }
00377     }
00378     numberMsg++;
00379     return JobCResult::kFailed;
00380   }
00382   //End of section to control which DP are written to file
00384 
00385   static Int_t firstTimeSec=timeSec;
00386   MAXMSG("LISummaryModule",Msg::kInfo,1)
00387     <<endl<<"First timestamp to be written out = "<<firstTimeSec<<endl; 
00388   
00389   //set the plex handle with the current vld context
00390   summarySorter.SetPlexHandle(rawliadcsummaryblock->GetVldContext());
00391 
00392   //update the sorter
00393   summarySorter.Update(led,pulseHeight,pulseWidth,pulserBox,calibPoint,
00394                        timeStamp,calibType,pulses,period);
00395 
00396   summarySorter.CountNumSummaries(rawliadcsummaryblock->
00397                                   GetNumberOfSummaries());
00398   //Work through all summaries
00399   for(Int_t n=0;n<rawliadcsummaryblock->GetNumberOfSummaries();n++){
00400     const RawLIAdcSummary *rawliadcsummary=
00401       rawliadcsummaryblock->At(n);
00402     
00403     mean=rawliadcsummary->GetMean();
00404     rms=rawliadcsummary->GetRms();
00405     numEntries=rawliadcsummary->GetEntries();
00406     
00407     summarySorter.AddEntry(rawliadcsummary->GetChannel(),
00408                            mean,rms,numEntries);  
00409 
00410     //fill the profiles used for debuging
00411     static Bool_t fillProfiles=false;
00412     if (fillProfiles) {
00413       MAXMSG("LISummaryModule",Msg::kInfo,500)
00414         <<"entries="<<numEntries<<", mean="<<mean<<", rms="<<rms<<endl;
00415 
00416       MAXMSG("LISummaryModule",Msg::kInfo,1)
00417         <<endl<<"Creating TProfile to look at entries in each summary"<<endl;
00418       static TProfile* pSummarySizeVsTF=new TProfile
00419         ("pSummarySizeVsTF","pSummarySizeVsTF",10000,0,10000);
00420       static TProfile* pSummarySizeVsTFAll=new TProfile
00421         ("pSummarySizeVsTFAll","pSummarySizeVsTFAll",10000,0,10000);
00422       static TProfile* pSummarySizeVsTF90=new TProfile
00423         ("pSummarySizeVsTF90","pSummarySizeVsTF90",10000,0,10000);
00424       static TH1F* hSummarySize=new TH1F
00425         ("hSummarySize","hSummarySize",1000,0,1000);//up to a kHz
00426       
00427       static vector<TProfile*> vProf50;
00428       static vector<TProfile*> vProf90;
00429       if (vProf50.size()==0){
00430         cout<<"Creating vector of TProfiles..."<<endl;
00431         for (Int_t i=0;i<=150;i++){
00432           string s="pSummaryEntVsTF50Pl";
00433           s+=Form("%d",i);
00434           cout<<"Creating TProfile with name="<<s<<endl;
00435           TProfile* p=new TProfile(s.c_str(),s.c_str(),10000,0,10000);
00436           vProf50.push_back(p);
00437           
00438           s="pSummaryEntVsTF90Pl";
00439           s+=Form("%d",i);
00440           cout<<"Creating TProfile with name="<<s<<endl;
00441           p=new TProfile(s.c_str(),s.c_str(),10000,0,10000);
00442           vProf90.push_back(p);
00443         }
00444       }
00445       
00446       PlexHandle ph(rawliadcsummaryblock->GetVldContext());
00447       Int_t plane=ph.GetSEIdAltL(rawliadcsummary->GetChannel()).GetPlane();
00448       MAXMSG("LISummaryModule",Msg::kInfo,500)
00449         <<endl<<"Filling TProfiles, plane="<<plane<<endl;
00450       if (plane>-1 && plane<150 && numEntries>90) vProf90[plane]->
00451         Fill(timeSec-firstTimeSec,numEntries);
00452       if (plane>-1 && plane<150 && numEntries>50) vProf50[plane]->
00453         Fill(timeSec-firstTimeSec,numEntries);
00454       
00455       //only fill if a decent number of entries are found
00456       if (numEntries>50) pSummarySizeVsTF->Fill(timeSec-firstTimeSec,numEntries);
00457       if (numEntries>90) pSummarySizeVsTF90->Fill(timeSec-firstTimeSec,numEntries);
00458       pSummarySizeVsTFAll->Fill(timeSec-firstTimeSec,numEntries);    
00459       hSummarySize->Fill(numEntries);
00460     }
00461   }
00462   //if control makes it this far then data will have been reconstructed
00463   fDataReconstructed=true;
00464   return result;
00465 }

void LISummaryModule::PrintBlockInfo ( string  preString  )  [private]

Definition at line 469 of file LISummaryModule.cxx.

References calibPoint, calibType, MuELoss::e, Form(), VldTimeStamp::GetSec(), Msg::kInfo, Msg::kVerbose, led, MSG, period, pulseHeight, pulserBox, pulses, pulseWidth, and timeStamp.

Referenced by GetSummaryBlocks().

00470 {
00471   MSG("LISummaryModule",Msg::kVerbose)<<"PrintBlockInfo..."<<endl;
00472 
00473   TDatime datime;
00474   datime.Set(timeStamp.GetSec());
00475   
00476   //play around with the formatting a little
00477   string sHour=Form("%d",datime.GetHour());
00478   string sMinute=Form("%d",datime.GetMinute());
00479   string sSecond=Form("%d",datime.GetSecond());
00480   string sMonth=Form("%d",datime.GetMonth());
00481   string sDay=Form("%d",datime.GetDay());
00482   if (datime.GetHour()<10) sHour="0"+sHour;
00483   if (datime.GetMinute()<10) sMinute="0"+sMinute;
00484   if (datime.GetSecond()<10) sSecond="0"+sSecond;
00485   if (datime.GetMonth()<10) sMonth="0"+sMonth;
00486   if (datime.GetDay()<10) sDay="0"+sDay;
00487 
00488   //protect from fpe
00489   Double_t pulseFreq=-1;
00490   if (period!=0) pulseFreq=ceil(1.0/(period*1.0e-5));
00491   string sPulseFreq=Form("%d",static_cast<Int_t>(pulseFreq));
00492   string sPeriod=Form("%d",static_cast<Int_t>(period));
00493   if (pulseFreq<0) sPulseFreq="??? (period="+sPeriod+")";
00494 
00495   MSG("LISummaryModule",Msg::kInfo) 
00496     <<preString 
00497     <<"PB="<<pulserBox 
00498     <<" Led="<<led
00499     <<" CP="<<calibPoint
00500     <<"/"<<calibType
00501     <<" PH="<<pulseHeight
00502     <<" PW="<<pulseWidth
00503     <<" PF="<<sPulseFreq
00504     <<" PN="<<pulses
00505     <<" at "<<sHour
00506     <<":"<<sMinute
00507     <<":"<<sSecond
00508     <<" on "<<datime.GetYear()
00509     <<"/"<<sMonth
00510     <<"/"<<sDay
00511     <<endl;
00512 
00513   MSG("LISummaryModule",Msg::kVerbose) 
00514     <<"PrintBlockInfo method finished"<<endl;
00515 }

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

Implement this for read-write access to the MomNavigator

Reimplemented from JobCModule.

Definition at line 94 of file LISummaryModule.cxx.

References MomNavigator::GetFragment(), GetPulserBlocks(), RawRecord::GetRawHeader(), RawDaqHeader::GetRun(), RawDaqHeader::GetRunType(), RawDaqHeader::GetSubRun(), GetSummaryBlocks(), VldContext::GetTimeStamp(), RecMinosHdr::GetVldContext(), Msg::kError, JobCResult::kPassed, Msg::kVerbose, MSG, LISummarySorter::SetDetector(), JobCResult::SetError(), JobCResult::SetFailed(), LISummarySorter::SetRawDaqVldCtx(), LISummarySorter::SetRunNumber(), LISummarySorter::SetRunNumberSub(), LISummarySorter::SetRunType(), and summarySorter.

00095 {
00096   JobCResult result(JobCResult::kPassed);
00097 
00098   //check that mom exists.
00099   assert(mom);
00100   
00101   //find raw record in mom
00102   RawRecord *rawrec = dynamic_cast<RawRecord *>
00103     (mom->GetFragment("RawRecord"));
00104   
00105   if (!rawrec) {
00106     result.SetError().SetFailed();
00107     MSG("LISummaryModule",Msg::kError) 
00108       <<"No raw record in mom"<<endl;
00109     return result;
00110   }
00111 
00112   //get raw header
00113   const RawDaqHeader *rawDaqHdr=
00114      dynamic_cast<const RawDaqHeader*>(rawrec->GetRawHeader());
00115   if (rawDaqHdr){
00116     summarySorter.SetRunNumber(rawDaqHdr->GetRun());
00117     summarySorter.SetRunNumberSub(rawDaqHdr->GetSubRun());
00118     summarySorter.SetRunType(rawDaqHdr->GetRunType());
00119     summarySorter.SetDetector(rawDaqHdr->GetVldContext());
00120     VldContext v=rawDaqHdr->GetVldContext();
00121     summarySorter.SetRawDaqVldCtx(v);
00122     MSG("LISummaryModule", Msg::kVerbose) 
00123       <<"Time in raw daq header is: "<<v.GetTimeStamp()<<endl;
00124   }
00125 
00126   Bool_t fUseSummaryBlocks=true;
00127   Bool_t fUsePulserBlocks=false;
00128 
00129   if (fUseSummaryBlocks){
00130     result=GetSummaryBlocks(rawrec);
00131     return result;
00132   }
00133   else if (fUsePulserBlocks){
00134     result=GetPulserBlocks(rawrec,mom);
00135     return result;
00136   }
00137   else{
00138     result.SetError().SetFailed();
00139     MSG("LISummaryModule",Msg::kError) 
00140       <<"Summary or Pulser Block not specified"<<endl;
00141     return result;
00142   }
00143 }


Member Data Documentation

Int_t LISummaryModule::calibPoint [private]

Definition at line 52 of file LISummaryModule.h.

Referenced by EndJob(), GetPulserBlocks(), GetSummaryBlocks(), and PrintBlockInfo().

Int_t LISummaryModule::calibType [private]

Definition at line 53 of file LISummaryModule.h.

Referenced by EndJob(), GetPulserBlocks(), GetSummaryBlocks(), and PrintBlockInfo().

Definition at line 54 of file LISummaryModule.h.

Referenced by EndJob(), and GetSummaryBlocks().

Int_t LISummaryModule::fLedLast [private]

Definition at line 57 of file LISummaryModule.h.

std::map<Int_t,Int_t> LISummaryModule::fLIRunSeqCurrent [private]

Definition at line 68 of file LISummaryModule.h.

Referenced by GetSummaryBlocks().

Definition at line 58 of file LISummaryModule.h.

Referenced by BeginJob(), Config(), and GetSummaryBlocks().

Definition at line 73 of file LISummaryModule.h.

Referenced by GetSummaryBlocks().

Definition at line 59 of file LISummaryModule.h.

Referenced by Config(), and GetSummaryBlocks().

Int_t LISummaryModule::led [private]

Definition at line 56 of file LISummaryModule.h.

Referenced by EndJob(), GetPulserBlocks(), GetSummaryBlocks(), and PrintBlockInfo().

Float_t LISummaryModule::mean [private]

Definition at line 60 of file LISummaryModule.h.

Referenced by GetPulserBlocks(), and GetSummaryBlocks().

Int_t LISummaryModule::numEntries [private]

Definition at line 61 of file LISummaryModule.h.

Referenced by GetPulserBlocks(), and GetSummaryBlocks().

Int_t LISummaryModule::period [private]

Definition at line 62 of file LISummaryModule.h.

Referenced by EndJob(), GetPulserBlocks(), GetSummaryBlocks(), and PrintBlockInfo().

Definition at line 63 of file LISummaryModule.h.

Referenced by EndJob(), GetPulserBlocks(), GetSummaryBlocks(), and PrintBlockInfo().

Int_t LISummaryModule::pulserBox [private]

Definition at line 64 of file LISummaryModule.h.

Referenced by EndJob(), GetPulserBlocks(), GetSummaryBlocks(), and PrintBlockInfo().

Int_t LISummaryModule::pulses [private]

Definition at line 65 of file LISummaryModule.h.

Referenced by EndJob(), GetPulserBlocks(), GetSummaryBlocks(), and PrintBlockInfo().

Int_t LISummaryModule::pulseWidth [private]

Definition at line 66 of file LISummaryModule.h.

Referenced by EndJob(), GetPulserBlocks(), GetSummaryBlocks(), and PrintBlockInfo().

Float_t LISummaryModule::rms [private]

Definition at line 67 of file LISummaryModule.h.

Referenced by GetPulserBlocks(), and GetSummaryBlocks().

Definition at line 55 of file LISummaryModule.h.

Referenced by EndJob(), GetPulserBlocks(), GetSummaryBlocks(), and Reco().

Definition at line 69 of file LISummaryModule.h.

Referenced by GetPulserBlocks(), and GetSummaryBlocks().

Int_t LISummaryModule::timeSec [private]

Definition at line 70 of file LISummaryModule.h.

Referenced by GetPulserBlocks(), and GetSummaryBlocks().

Definition at line 71 of file LISummaryModule.h.

Referenced by EndJob(), GetPulserBlocks(), GetSummaryBlocks(), and PrintBlockInfo().


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

Generated on 2 Nov 2017 for loon by  doxygen 1.6.1