PulserFromRawCollectorModule Class Reference

#include <PulserFromRawCollectorModule.h>

Inheritance diagram for PulserFromRawCollectorModule:
JobCModule

List of all members.

Public Member Functions

 PulserFromRawCollectorModule ()
 ~PulserFromRawCollectorModule ()
JobCResult Reco (MomNavigator *mom)
void HandleCommand (JobCommand *command)

Private Member Functions

JobCResult ReferencePointReco (MomNavigator *mom)
void WriteRawCurveData (PulserFromRawSummaryList *psl)
void WriteRawDriftData (PulserFromRawSummaryList *psl)
void WriteReferenceDriftData (PulserFromRawSummaryList *psl)

Private Attributes

Int_t fIdent
std::map< Int_t, PulserRawGainfNearMapCurve
std::map< Int_t, PulserRawGainFfFarMapCurve
PulserRawGainPin fHighPinCurve
PulserRawGainPin fLowPinCurve
std::map< Int_t, PulserRawDriftfNearMapDrift
std::map< Int_t, PulserRawDriftFfFarMapDrift
PulserRawDriftPin fHighPinDrift
PulserRawDriftPin fLowPinDrift
std::map< Int_t, PulserRefDriftfNearMapRef
std::map< Int_t, PulserRefDriftFfFarMapRef
PulserRefDriftPin fHighPinRef
PulserRefDriftPin fLowPinRef
int fGCValid
int fDPValid
int fLongTime
int fDoReferencePoint

Detailed Description

Definition at line 32 of file PulserFromRawCollectorModule.h.


Constructor & Destructor Documentation

PulserFromRawCollectorModule::PulserFromRawCollectorModule (  ) 

Definition at line 31 of file PulserFromRawCollectorModule.cxx.

00032 {
00033   fDoReferencePoint=0;
00034   fIdent = 0; 
00035   fGCValid = 3600*24*62; // 2 months validity for Gaincurve
00036   fDPValid = 3600*24*1;  // Driftpoint valid up to a day?
00037   fLongTime = 3600*24*365*20; // 20 yrs
00038 }

PulserFromRawCollectorModule::~PulserFromRawCollectorModule (  ) 

Definition at line 40 of file PulserFromRawCollectorModule.cxx.

00041 {
00042 
00043 }


Member Function Documentation

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

Implement to handle a JobCommand

Reimplemented from JobCModule.

Definition at line 285 of file PulserFromRawCollectorModule.cxx.

References fDoReferencePoint, Msg::kDebug, Msg::kWarning, MSG, and JobCommand::PopCmd().

00286 {
00287 
00288 // Process configuration commands
00289   TString cmd = command->PopCmd();
00290 
00291   MSG("Pulser", Msg::kDebug)
00292                    << "PulserFromRawCollectorModule:HandleCommand: " << cmd << endl;
00293   if (cmd == "Reference") {
00294      fDoReferencePoint=1;
00295   }
00296   else {
00297      MSG("Pulser", Msg::kWarning)
00298                           << "Unrecognized Command: " << cmd << endl;
00299   }
00300 
00301 }

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

Implement this for read-write access to the MomNavigator

Reimplemented from JobCModule.

Definition at line 94 of file PulserFromRawCollectorModule.cxx.

References PulserRawGainPin::AddPoint(), fDoReferencePoint, fFarMapCurve, fFarMapDrift, fHighPinCurve, fHighPinDrift, fIdent, fLowPinCurve, fLowPinDrift, fNearMapCurve, fNearMapDrift, PulserFromRawSummaryList::GetAggregateNo(), PulserFromRawSummaryList::GetExpectedPoints(), PulserFromRawSummaryList::GetFarBegin(), PulserFromRawSummaryList::GetFarEnd(), MomNavigator::GetFragment(), PulserFromRawSummaryList::GetHighPin(), PulserFromRawSummaryList::GetIdent(), PulserFromRawSummaryList::GetLowPin(), PulserFromRawSummaryList::GetNearBegin(), PulserFromRawSummaryList::GetNearEnd(), PulserSummary::GetPinDiodeId(), PulserFromRawSummaryList::GetPointIndex(), it, Msg::kDebug, JobCResult::kFailed, JobCResult::kPassed, Msg::kVerbose, Msg::kWarning, MSG, PulserRawDriftPin::New(), PulserRawGainPin::New(), ReferencePointReco(), WriteRawCurveData(), and WriteRawDriftData().

00095 {
00096    if(fDoReferencePoint) {
00097       return ReferencePointReco(mom);
00098    }
00099    //Get PulserSummary...
00100    PulserFromRawSummaryList *psl = dynamic_cast<PulserFromRawSummaryList *>
00101       (mom->GetFragment("PulserFromRawSummaryList"));
00102    if (psl==0) {
00103       MSG("Pulser",Msg::kVerbose) <<"No pulser summary list here\n";
00104       return JobCResult::kFailed;
00105    }
00106    MSG("Pulser",Msg::kDebug) <<"Got pulser summary "<<psl->GetPointIndex()
00107                              <<" of "<<psl->GetExpectedPoints()<<endl;
00108    int point = psl->GetPointIndex();
00109    switch(psl->GetExpectedPoints()) {
00110    case 0:
00111       // Noise - no pulsing
00112       break;
00113    case 1:
00114       // Doug Point
00115       MSG("Pulser",Msg::kDebug) <<"Doug Point"<<endl;
00116       fHighPinDrift.New(psl->GetAggregateNo(),
00117                         psl->GetHighPin().GetPinDiodeId(),
00118                         psl->GetHighPin());
00119       fLowPinDrift.New(psl->GetAggregateNo(),
00120                        psl->GetLowPin().GetPinDiodeId(),
00121                        psl->GetLowPin());
00122       // Loop over near end data
00123       for (std::map<Int_t,PulserSummary>::const_iterator it=psl->GetNearBegin();
00124            it!=psl->GetNearEnd(); it++) {
00125          fNearMapDrift[(*it).first].New(psl->GetAggregateNo(),
00126                                         (*it).second.GetStripEndId().BuildPlnStripEndKey(),
00127                                         (*it).second);
00128       }
00129       for (std::map<Int_t,PulserSummary>::const_iterator it=psl->GetFarBegin();
00130            it!=psl->GetFarEnd(); it++) {
00131          fFarMapDrift[(*it).first].New(psl->GetAggregateNo(),
00132                                        (*it).second.GetStripEndId().BuildPlnStripEndKey(),
00133                                        (*it).second);
00134       }
00135       WriteRawDriftData(psl);
00136       break;
00137    default:
00138       // Gain Curve
00139       // Check we're on the right curve...
00140       if (fIdent!=0 && fIdent!=psl->GetIdent()) {
00141          MSG("Pulser",Msg::kWarning)<< "Conflicting gaincurves in same place!\n";
00142       }
00143       if (fIdent==0) {
00144          fHighPinCurve.New(psl->GetAggregateNo(),psl->GetExpectedPoints(),
00145                            psl->GetHighPin().GetPinDiodeId());
00146          fLowPinCurve.New(psl->GetAggregateNo(),psl->GetExpectedPoints(),
00147                           psl->GetLowPin().GetPinDiodeId());
00148          fIdent = psl->GetIdent();
00149       }
00150       MSG("Pulser",Msg::kDebug) <<"Gain Curve"<<endl;
00151       // Loop over near end data
00152       for (std::map<Int_t,PulserSummary>::const_iterator it=psl->GetNearBegin();
00153            it!=psl->GetNearEnd(); it++) {
00154          if (!fNearMapCurve.count((*it).first)) {
00155             fNearMapCurve[(*it).first].New(psl->GetAggregateNo(),
00156                                            psl->GetExpectedPoints(),
00157                                            (*it).first);
00158          }
00159          fNearMapCurve[(*it).first].AddPoint(point,(*it).second);
00160     }
00161       for (std::map<Int_t,PulserSummary>::const_iterator it=psl->GetFarBegin();
00162            it!=psl->GetFarEnd(); it++) {
00163          if (!fFarMapCurve.count((*it).first))    {
00164             fFarMapCurve[(*it).first].New(psl->GetAggregateNo(),
00165                                           psl->GetExpectedPoints(),
00166                                           (*it).first);
00167          }
00168          fFarMapCurve[(*it).first].AddPoint(point,(*it).second);
00169       }
00170       fHighPinCurve.AddPoint(point,psl->GetHighPin());
00171       fLowPinCurve.AddPoint(point,psl->GetLowPin());
00172       if (point == psl->GetExpectedPoints()||point==37){
00173          // Got curve - now write DB
00174          WriteRawCurveData(psl);
00175       }
00176       
00177    }
00178    return JobCResult::kPassed;
00179 
00180 }

JobCResult PulserFromRawCollectorModule::ReferencePointReco ( MomNavigator mom  )  [private]

Definition at line 45 of file PulserFromRawCollectorModule.cxx.

References fFarMapRef, fHighPinRef, fLowPinRef, fNearMapRef, PulserFromRawSummaryList::GetAggregateNo(), PulserFromRawSummaryList::GetExpectedPoints(), PulserFromRawSummaryList::GetFarBegin(), PulserFromRawSummaryList::GetFarEnd(), MomNavigator::GetFragment(), PulserFromRawSummaryList::GetHighPin(), PulserFromRawSummaryList::GetLowPin(), PulserFromRawSummaryList::GetNearBegin(), PulserFromRawSummaryList::GetNearEnd(), PulserSummary::GetPinDiodeId(), PulserFromRawSummaryList::GetPointIndex(), it, Msg::kDebug, JobCResult::kFailed, JobCResult::kPassed, Msg::kVerbose, MSG, PulserRefDriftPin::New(), and WriteReferenceDriftData().

Referenced by Reco().

00046 {
00047    //Get PulserSummary...
00048    PulserFromRawSummaryList *psl = dynamic_cast<PulserFromRawSummaryList *>
00049       (mom->GetFragment("PulserFromRawSummaryList"));
00050    if (psl==0) {
00051       MSG("Pulser",Msg::kVerbose) <<"No pulser summary list here\n";
00052       return JobCResult::kFailed;
00053    }
00054    MSG("Pulser",Msg::kDebug) <<"Got pulser summary "<<psl->GetPointIndex()
00055                              <<" of "<<psl->GetExpectedPoints()<<endl;
00056    // int point = psl->GetPointIndex();
00057    switch(psl->GetExpectedPoints()) {
00058    case 0:
00059       // Noise - no pulsing
00060       break;
00061   case 1:
00062      // Doug Point
00063      MSG("Pulser",Msg::kDebug) <<"Doug Point"<<endl;
00064      ;
00065      fHighPinRef.New(psl->GetAggregateNo(),
00066                      psl->GetHighPin().GetPinDiodeId(),
00067                      psl->GetHighPin());
00068      fLowPinRef.New(psl->GetAggregateNo(),
00069                     psl->GetLowPin().GetPinDiodeId(),
00070                     psl->GetLowPin());
00071      // Loop over near end data
00072      for (std::map<Int_t,PulserSummary>::const_iterator it=psl->GetNearBegin();
00073           it!=psl->GetNearEnd(); it++) {
00074         fNearMapRef[(*it).first].New(psl->GetAggregateNo(),
00075                                      (*it).second.GetStripEndId().BuildPlnStripEndKey(),
00076                                      (*it).second);
00077      }
00078      for (std::map<Int_t,PulserSummary>::const_iterator it=psl->GetFarBegin();
00079           it!=psl->GetFarEnd(); it++) {
00080         fFarMapRef[(*it).first].New(psl->GetAggregateNo(),
00081                                     (*it).second.GetStripEndId().BuildPlnStripEndKey(),
00082                                     (*it).second);
00083      }
00084      WriteReferenceDriftData(psl);
00085      break;
00086    default:
00087       return JobCResult::kFailed;
00088    }
00089    return JobCResult::kPassed;
00090 }

void PulserFromRawCollectorModule::WriteRawCurveData ( PulserFromRawSummaryList psl  )  [private]

Definition at line 184 of file PulserFromRawCollectorModule.cxx.

References VldTimeStamp::Add(), DbiWriter< T >::Close(), fFarMapCurve, fGCValid, fHighPinCurve, fIdent, fLowPinCurve, fNearMapCurve, PulserFromRawSummaryList::GetAggregateNo(), VldContext::GetDetector(), VldContext::GetSimFlag(), VldContext::GetTimeStamp(), PulserFromRawSummaryList::GetVldContext(), it, Msg::kDebug, and MSG.

Referenced by Reco().

00185 {
00186    VldContext vld = psl->GetVldContext();
00187    VldTimeStamp start = vld.GetTimeStamp();
00188    VldTimeStamp end = start;
00189    end.Add(VldTimeStamp(fGCValid,0));
00190    VldRange vr(vld.GetDetector(),vld.GetSimFlag(),start,
00191                end, "PulserFromRawCollectorModule");
00192    VldTimeStamp create; // now!
00193    int aggNo = psl->GetAggregateNo();
00194    DbiWriter<PulserRawGain> writer(vr,aggNo,0,start);
00195    MSG("Pulser",Msg::kDebug)<<"Writing database "<<psl->GetVldContext()<<endl;
00196    for (std::map <Int_t,PulserRawGain>::const_iterator 
00197            it = fNearMapCurve.begin(); it!=fNearMapCurve.end(); it++) {
00198       writer << (*it).second;
00199    }
00200    writer.Close();
00201    DbiWriter<PulserRawGainF> fwriter(vr,aggNo,0,start);
00202    for (std::map <Int_t,PulserRawGainF>::const_iterator 
00203            it = fFarMapCurve.begin(); it!=fFarMapCurve.end(); it++) {
00204       fwriter << (*it).second;
00205    }
00206    fwriter.Close();
00207    DbiWriter<PulserRawGainPin> w(vr,aggNo,0,start);
00208    w << fHighPinCurve;
00209    w << fLowPinCurve;
00210    w.Close();
00211    fNearMapCurve.clear();
00212    fFarMapCurve.clear();
00213    fIdent=0;
00214 }

void PulserFromRawCollectorModule::WriteRawDriftData ( PulserFromRawSummaryList psl  )  [private]

Definition at line 253 of file PulserFromRawCollectorModule.cxx.

References VldTimeStamp::Add(), DbiWriter< T >::Close(), fDPValid, fFarMapDrift, fHighPinDrift, fLowPinDrift, fNearMapDrift, PulserFromRawSummaryList::GetAggregateNo(), VldContext::GetDetector(), VldContext::GetSimFlag(), VldContext::GetTimeStamp(), PulserFromRawSummaryList::GetVldContext(), it, Msg::kDebug, and MSG.

Referenced by Reco().

00254 {
00255    VldContext vld = psl->GetVldContext();
00256    VldTimeStamp start = vld.GetTimeStamp();
00257    VldTimeStamp end = start;
00258    end.Add(VldTimeStamp(fDPValid,0));
00259    VldRange vr(vld.GetDetector(),vld.GetSimFlag(),start,
00260                end, "PulserFromRawCollectorModule");
00261    VldTimeStamp create; // now!
00262    int aggNo = psl->GetAggregateNo();
00263    DbiWriter<PulserRawDrift> writer(vr,aggNo,0,start);
00264    MSG("Pulser",Msg::kDebug)<<"Writing database "<<psl->GetVldContext()<<endl;
00265    for (std::map <Int_t,PulserRawDrift>::const_iterator 
00266            it = fNearMapDrift.begin(); it!=fNearMapDrift.end(); it++) {
00267       writer << (*it).second;
00268    }
00269    writer.Close();
00270    DbiWriter<PulserRawDriftF> fwriter(vr,aggNo,0,start);
00271    for (std::map <Int_t,PulserRawDriftF>::const_iterator 
00272            it = fFarMapDrift.begin(); it!=fFarMapDrift.end(); it++) {
00273       fwriter << (*it).second;
00274    }
00275    fwriter.Close();
00276    DbiWriter<PulserRawDriftPin> w(vr,aggNo,0,start);
00277    w << fHighPinDrift;
00278    w << fLowPinDrift;
00279    w.Close();
00280    fNearMapDrift.clear();
00281    fFarMapDrift.clear();
00282 }

void PulserFromRawCollectorModule::WriteReferenceDriftData ( PulserFromRawSummaryList psl  )  [private]

Definition at line 216 of file PulserFromRawCollectorModule.cxx.

References DbiWriter< T >::Close(), fFarMapRef, fHighPinRef, fLowPinRef, fNearMapRef, PulserFromRawSummaryList::GetAggregateNo(), VldContext::GetDetector(), VldContext::GetSimFlag(), PulserFromRawSummaryList::GetVldContext(), it, Msg::kDebug, and MSG.

Referenced by ReferencePointReco().

00217 {
00218    VldContext vld = psl->GetVldContext();
00219    //   VldTimeStamp start = vld.GetTimeStamp();
00220    //VldTimeStamp start = vld.GetTimeStamp();
00221    //VldTimeStamp end = start;
00222    //end.Add(VldTimeStamp(fDPValid,0));
00223    VldTimeStamp start = VldTimeStamp(2002,9,4,15,0,1); //Valid For all time
00224    VldTimeStamp end = VldTimeStamp(2002,10,2,0,0,0);
00225    //end.Add(VldTimeStamp(fLongTime,0));
00226    VldRange vr(vld.GetDetector(),vld.GetSimFlag(),start,
00227                end, "PulserFromRawCollectorModule");
00228    VldTimeStamp create; // now!
00229    int aggNo = psl->GetAggregateNo();
00230    DbiWriter<PulserRefDrift> writer(vr,aggNo,0,start);
00231    MSG("Pulser",Msg::kDebug)<<"Writing database "<<psl->GetVldContext()<<endl;
00232    for (std::map <Int_t,PulserRefDrift>::const_iterator 
00233            it = fNearMapRef.begin(); it!=fNearMapRef.end(); it++) {
00234       //MSG("Pulser",Msg::kWarning)<<"RefDrift: " << (*it).first << endl;
00235       writer << (*it).second;
00236    }
00237    writer.Close();
00238    DbiWriter<PulserRefDriftF> fwriter(vr,aggNo,0,start);
00239    for (std::map <Int_t,PulserRefDriftF>::const_iterator 
00240            it = fFarMapRef.begin(); it!=fFarMapRef.end(); it++) {
00241       fwriter << (*it).second;
00242    }
00243    fwriter.Close();
00244    DbiWriter<PulserRefDriftPin> w(vr,aggNo,0,start);
00245    w << fHighPinRef;
00246    w << fLowPinRef;
00247    w.Close();
00248    fNearMapRef.clear();
00249    fFarMapRef.clear();
00250 }


Member Data Documentation

Definition at line 69 of file PulserFromRawCollectorModule.h.

Referenced by HandleCommand(), and Reco().

Definition at line 67 of file PulserFromRawCollectorModule.h.

Referenced by WriteRawDriftData().

Definition at line 50 of file PulserFromRawCollectorModule.h.

Referenced by Reco(), and WriteRawCurveData().

Definition at line 56 of file PulserFromRawCollectorModule.h.

Referenced by Reco(), and WriteRawDriftData().

Definition at line 62 of file PulserFromRawCollectorModule.h.

Referenced by ReferencePointReco(), and WriteReferenceDriftData().

Definition at line 66 of file PulserFromRawCollectorModule.h.

Referenced by WriteRawCurveData().

Definition at line 51 of file PulserFromRawCollectorModule.h.

Referenced by Reco(), and WriteRawCurveData().

Definition at line 57 of file PulserFromRawCollectorModule.h.

Referenced by Reco(), and WriteRawDriftData().

Definition at line 63 of file PulserFromRawCollectorModule.h.

Referenced by ReferencePointReco(), and WriteReferenceDriftData().

Definition at line 48 of file PulserFromRawCollectorModule.h.

Referenced by Reco(), and WriteRawCurveData().

Definition at line 68 of file PulserFromRawCollectorModule.h.

Definition at line 52 of file PulserFromRawCollectorModule.h.

Referenced by Reco(), and WriteRawCurveData().

Definition at line 58 of file PulserFromRawCollectorModule.h.

Referenced by Reco(), and WriteRawDriftData().

Definition at line 64 of file PulserFromRawCollectorModule.h.

Referenced by ReferencePointReco(), and WriteReferenceDriftData().

Definition at line 49 of file PulserFromRawCollectorModule.h.

Referenced by Reco(), and WriteRawCurveData().

Definition at line 55 of file PulserFromRawCollectorModule.h.

Referenced by Reco(), and WriteRawDriftData().

Definition at line 61 of file PulserFromRawCollectorModule.h.

Referenced by ReferencePointReco(), and WriteReferenceDriftData().


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

Generated on 2 Nov 2017 for loon by  doxygen 1.6.1