CMS 3D CMS Logo

FineDelayTask Class Reference

#include <DQM/SiStripCommissioningSources/interface/FineDelayTask.h>

Inheritance diagram for FineDelayTask:

CommissioningTask

List of all members.

Public Member Functions

 FineDelayTask (DQMStore *, const FedChannelConnection &)
virtual ~FineDelayTask ()

Private Member Functions

virtual void book ()
virtual void fill (const SiStripEventSummary &, const edm::DetSet< SiStripRawDigi > &)
virtual void update ()

Private Attributes

float fiberLengthCorrection_
HistoSettiming_

Static Private Attributes

static std::map< std::string,
HistoSet
timingMap_


Detailed Description

Definition at line 11 of file FineDelayTask.h.


Constructor & Destructor Documentation

FineDelayTask::FineDelayTask ( DQMStore dqm,
const FedChannelConnection conn 
)

Definition at line 17 of file FineDelayTask.cc.

References c, FedChannelConnection::fiberLength(), fiberLengthCorrection_, and LogDebug.

00018                                                                  :
00019   CommissioningTask( dqm, conn, "FineDelayTask" ), timing_(0)
00020 {
00021   LogDebug("Commissioning") << "[FineDelayTask::FineDelayTask] Constructing object...";
00022   // compute the fiber length correction
00023   float length=conn.fiberLength();
00024   // convert cm to ns
00025   float c=30; //speed of light in cm/ns
00026   float refractionIndex = 1.4; // refraction index of the optical fibers
00027   fiberLengthCorrection_ =  length/c*refractionIndex;
00028 }

FineDelayTask::~FineDelayTask (  )  [virtual]

Definition at line 32 of file FineDelayTask.cc.

References LogDebug.

00032                               {
00033   LogDebug("Commissioning") << "[FineDelayTask::FineDelayTask] Destructing object...";
00034 }


Member Function Documentation

void FineDelayTask::book (  )  [private, virtual]

Reimplemented from CommissioningTask.

Definition at line 38 of file FineDelayTask.cc.

References sistrip::DET_KEY, CommissioningTask::dqm(), sistrip::EXPERT_HISTO, sistrip::FINE_DELAY, HIGHBIN, LogDebug, LOWBIN, NBINS, timing_, timingMap_, indexGen::title, sistrip::TRACKER, and CommissioningTask::HistoSet::vNumOfEntries_.

00038                          {
00039   LogDebug("Commissioning") << "[FineDelayTask::book]";
00040 
00041   // construct the histo title
00042   // by setting the granularity to sistrip::TRACKER, the title will be identical for all detkeys.
00043   // therefore, only one histo will be booked/analyzed
00044   std::string title = SiStripHistoTitle( sistrip::EXPERT_HISTO, 
00045                                          sistrip::FINE_DELAY, 
00046                                          sistrip::DET_KEY, 
00047                                          0,
00048                                          sistrip::TRACKER, 
00049                                          0 ).title(); 
00050   // look if such an histogram is already booked
00051   if(timingMap_.find(title)!=timingMap_.end()) {
00052     // if already booked, use it
00053     LogDebug("Commissioning") << "[FineDelayTask::book] using existing histogram.";
00054   } else {
00055     // if not, book it
00056     int nBins = NBINS;
00057     LogDebug("Commissioning") << "[LatencyTask::book] booking a new histogram.";
00058     timingMap_[title].histo( dqm()->bookProfile( title, title,    // name and title
00059                                                  nBins, LOWBIN, HIGHBIN,   // binning + range
00060                                                  100, 0., -1., "s" ) );  // Y range : automatic
00061 
00062     timingMap_[title].vNumOfEntries_.resize(nBins,0);
00063     timingMap_[title].vSumOfContents_.resize(nBins,0);
00064     timingMap_[title].vSumOfSquares_.resize(nBins,0);
00065   }
00066   timing_ = &(timingMap_[title]);
00067   LogDebug("Commissioning") << "Binning is " << timing_->vNumOfEntries_.size();
00068   LogDebug("Commissioning") << "[FineDelayTask::book] done";
00069   
00070 }

void FineDelayTask::fill ( const SiStripEventSummary summary,
const edm::DetSet< SiStripRawDigi > &  digis 
) [private, virtual]

Reimplemented from CommissioningTask.

Definition at line 74 of file FineDelayTask.cc.

References edm::DetSet< T >::data, HIGHBIN, int, LogDebug, LOWBIN, NBINS, strip(), timing_, and CommissioningTask::updateHistoSet().

00075                                                                    {
00076   LogDebug("Commissioning") << "[FineDelayTask::fill]";
00077   // retrieve the delay from the EventSummary
00078   float delay = const_cast<SiStripEventSummary&>(summary).ttcrx();
00079   float correctedDelay = delay;
00080   LogDebug("Commissioning") << "[FineDelayTask::fill]; the delay is " << delay;
00081   // loop on the strips to find the (maybe) non-zero digi
00082   for(unsigned int strip=0;strip<digis.data.size();strip++) {
00083     if(digis.data[strip].adc()!=0) {
00084       // apply the TOF correction
00085       float tof = (digis.data[strip].adc()>>8)/10.;
00086       correctedDelay = delay - tof;
00087       if((digis.data[strip].adc()>>8)==255) continue; // skip hit if TOF is in overflow
00088       // compute the bin
00089       float nbins = NBINS;
00090       float lowbin = LOWBIN;
00091       float highbin = HIGHBIN;
00092       int bin = int((correctedDelay-lowbin)/((highbin-lowbin)/nbins));
00093       LogDebug("Commissioning") << "[FineDelayTask::fill]; using a hit with value " << ( digis.data[strip].adc()&0xff )
00094                                 << " at corrected delay of " << correctedDelay
00095                                 << " in bin " << bin << "  (tof is " << tof << "( since adc = " << digis.data[strip].adc() << "))";
00096       updateHistoSet( *timing_,bin,digis.data[strip].adc()&0xff);
00097     }
00098   }
00099 }

void FineDelayTask::update (  )  [private, virtual]

Reimplemented from CommissioningTask.

Definition at line 103 of file FineDelayTask.cc.

References LogDebug, timing_, and CommissioningTask::updateHistoSet().

00103                            {
00104   LogDebug("Commissioning") << "[FineDelayTask::update]";
00105   updateHistoSet( *timing_ );
00106 }


Member Data Documentation

float FineDelayTask::fiberLengthCorrection_ [private]

Definition at line 28 of file FineDelayTask.h.

Referenced by FineDelayTask().

HistoSet* FineDelayTask::timing_ [private]

Definition at line 26 of file FineDelayTask.h.

Referenced by book(), fill(), and update().

std::map< std::string, CommissioningTask::HistoSet > FineDelayTask::timingMap_ [static, private]

Definition at line 25 of file FineDelayTask.h.

Referenced by book().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:20:54 2009 for CMSSW by  doxygen 1.5.4