OltTimePlot Class Reference

#include <OltTimePlot.h>

Inheritance diagram for OltTimePlot:
JobCModule

List of all members.

Public Member Functions

 OltTimePlot ()
 ~OltTimePlot ()
JobCResult Reco (MomNavigator *mom)
const RegistryDefaultConfig () const
void Config (const Registry &r)

Private Attributes

PlexHandlefPlex
TFile * fFile

Detailed Description

Definition at line 28 of file OltTimePlot.h.


Constructor & Destructor Documentation

OltTimePlot::OltTimePlot (  ) 

Definition at line 57 of file OltTimePlot.cxx.

00058 {
00059   TDirectory *save = gDirectory;
00060   fFile = new TFile("/home/pa/timeplot.root","RECREATE");
00061   save->cd();
00062   fPlex = 0;
00063 }

OltTimePlot::~OltTimePlot (  ) 

Definition at line 65 of file OltTimePlot.cxx.

References fFile.

00066 {
00067   TDirectory *save = gDirectory;
00068   fFile->cd();
00069   fFile->Close();
00070   save->cd();
00071 }


Member Function Documentation

void OltTimePlot::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 154 of file OltTimePlot.cxx.

00155 {
00156   //int   tmpb;
00157 
00158 }

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

References JobCModule::GetName(), Registry::LockValues(), and Registry::UnLockValues().

00135 {
00136 
00137   static Registry r; // Default configuration for module
00138 
00139 
00140   std::string name = this->JobCModule::GetName();
00141   name += ".config.default";
00142   r.SetName(name.c_str());
00143 
00144   // Set values in configuration
00145   r.UnLockValues();
00146 
00147   r.LockValues();
00148 
00149   return r;
00150 }

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

Implement this for read-write access to the MomNavigator

Reimplemented from JobCModule.

Definition at line 73 of file OltTimePlot.cxx.

References fFile, fPlex, MomNavigator::FragmentIter(), RawDigit::GetChannel(), RawDigitDataBlock::GetDatumIter(), PlexSEIdAltL::GetPlane(), RawRecord::GetRawBlockIter(), PlexHandle::GetSEIdAltL(), RawSnarlHeaderBlock::GetSnarl(), RawDigit::GetTDC(), RawSnarlHeaderBlock::GetTimeFrameNo(), RawSnarlHeaderBlock::GetVldContext(), id, it, JobCResult::kAOK, Detector::kCalDet, and ElecType::kVA.

00074 {
00075   int snarl=0,tf=0;
00076   TIter iter = mom->FragmentIter();
00077   while (TObject *obj = iter.Next()) {
00078     RawRecord *rawrec = dynamic_cast<RawRecord *>(obj);
00079     if (rawrec) {
00080       TIter recit = rawrec->GetRawBlockIter();
00081       while (TObject *obj = recit.Next()) {
00082         RawDataBlock *rawdata = dynamic_cast<RawDataBlock *>(obj);
00083         if (rawdata) {
00084           if (rawdata->InheritsFrom("RawSnarlHeaderBlock")) {
00085             RawSnarlHeaderBlock *rshb =dynamic_cast<RawSnarlHeaderBlock *>(rawdata);
00086              tf = rshb->GetTimeFrameNo();
00087              snarl = rshb->GetSnarl();
00088              if (!fPlex) fPlex = new PlexHandle(rshb->GetVldContext());
00089           }
00090           
00091           RawDigitDataBlock *rddb = dynamic_cast<RawDigitDataBlock *>(rawdata);
00092           if (rddb) {
00093             RawChannelId id(Detector::kCalDet,
00094                             ElecType::kVA,0,0x1602);
00095             id.SetModeBits(true,true,true);
00096             map<int,int> times;
00097             int t0 = 0;
00098             TIter it = rddb->GetDatumIter();
00099             while (TObject *obj = it.Next()) {
00100               RawVaDigit *rvd = dynamic_cast<RawVaDigit *>(obj);
00101               if (rvd) {
00102                 RawChannelId rcid = rvd->GetChannel();
00103                 PlexSEIdAltL altl= fPlex->GetSEIdAltL(rcid);
00104 
00105                 times.insert(make_pair(rvd->GetTDC(),altl.GetPlane()));
00106 //cout<<rvd->GetChannel()<<" "<<id<<endl;
00107                 if (rcid == id) t0 = rvd->GetTDC();
00108               }
00109             }
00110             TDirectory *save = gDirectory;
00111             char hname[100];
00112             sprintf(hname,"snarl%d",snarl);
00113             TH1F h(hname,hname,200,-1000,1000);
00114             sprintf(hname,"psnarl%d",snarl);
00115             TH2F hh(hname,hname,50,-1000,1000,30,0,60);
00116             for (map<int,int>::iterator it =
00117 times.begin();it!=times.end();it++) {
00118               h.Fill((*it).first-t0);
00119               hh.Fill((*it).first-t0,(*it).second);
00120 //cout<<(*it)<<"  "<<t0<<endl;
00121             }
00122             fFile->cd();
00123             h.Write();
00124             hh.Write();
00125             save->cd();
00126           }
00127         }
00128       }
00129     }
00130   }
00131   return JobCResult::kAOK;
00132 }


Member Data Documentation

TFile* OltTimePlot::fFile [private]

Definition at line 41 of file OltTimePlot.h.

Referenced by Reco(), and ~OltTimePlot().

Definition at line 40 of file OltTimePlot.h.

Referenced by Reco().


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

Generated on 2 Nov 2017 for loon by  doxygen 1.6.1