![]() |
![]() |
#include <DQM/SiStripCommissioningSources/interface/LatencyTask.h>
Public Member Functions | |
LatencyTask (DQMStore *, const FedChannelConnection &) | |
virtual | ~LatencyTask () |
Private Member Functions | |
virtual void | book () |
virtual void | fill (const SiStripEventSummary &, const edm::DetSet< SiStripRawDigi > &) |
virtual void | update () |
Private Attributes | |
HistoSet * | cluster_ |
HistoSet * | clusterPartition_ |
int | firstReading_ |
HistoSet * | timing_ |
HistoSet * | timingPartition_ |
Static Private Attributes | |
static std::map< std::string, HistoSet > | clusterMap_ |
static std::map< std::string, HistoSet > | timingMap_ |
Definition at line 11 of file LatencyTask.h.
LatencyTask::LatencyTask | ( | DQMStore * | dqm, | |
const FedChannelConnection & | conn | |||
) |
Definition at line 18 of file LatencyTask.cc.
References LogDebug.
00019 : 00020 CommissioningTask( dqm, conn, "LatencyTask" ),timing_(0),cluster_(0),firstReading_(-1) 00021 { 00022 LogDebug("Commissioning") << "[LatencyTask::LatencyTask] Constructing object..."; 00023 }
LatencyTask::~LatencyTask | ( | ) | [virtual] |
Definition at line 27 of file LatencyTask.cc.
References LogDebug.
00027 { 00028 LogDebug("Commissioning") << "[LatencyTask::LatencyTask] Destructing object..."; 00029 }
void LatencyTask::book | ( | ) | [private, virtual] |
Reimplemented from CommissioningTask.
Definition at line 33 of file LatencyTask.cc.
References sistrip::APV_LATENCY, cluster_, sistrip::extrainfo::clusterCharge_, clusterMap_, clusterPartition_, CommissioningTask::connection(), sistrip::controlView_, sistrip::DET_KEY, detId, CommissioningTask::dqm(), sistrip::EXPERT_HISTO, HIGHBIN, LogDebug, LOWBIN, NBINS, sistrip::extrainfo::occupancy_, sistrip::PARTITION, DQMStore::pwd(), sistrip::root_, DQMStore::setCurrentFolder(), timing_, timingMap_, timingPartition_, indexGen::title, and sistrip::TRACKER.
00033 { 00034 LogDebug("Commissioning") << "[LatencyTask::book]"; 00035 00036 // construct the histo title 00037 // by setting the granularity to sistrip::TRACKER, the title will be identical for all detkeys. 00038 // therefore, only one histo will be booked/analyzed 00039 std::string title = SiStripHistoTitle( sistrip::EXPERT_HISTO, 00040 sistrip::APV_LATENCY, 00041 sistrip::DET_KEY, 00042 0, 00043 sistrip::TRACKER, 00044 0, 00045 sistrip::extrainfo::clusterCharge_).title(); 00046 // look if such an histogram is already booked 00047 if(timingMap_.find(title)!=timingMap_.end()) { 00048 // if already booked, use it 00049 LogDebug("Commissioning") << "[LatencyTask::book] using existing histogram."; 00050 } else { 00051 // if not, book it 00052 timingMap_[title] = HistoSet(); 00053 int nBins = NBINS; 00054 std::string pwd = dqm()->pwd(); 00055 std::string rootDir = pwd.substr(0,pwd.find(sistrip::root_ + "/")+sistrip::root_.size()); 00056 rootDir += "/"; rootDir += sistrip::controlView_; 00057 dqm()->setCurrentFolder( rootDir ); 00058 LogDebug("Commissioning") << "[LatencyTask::book] booking a new histogram in " << dqm()->pwd(); 00059 timingMap_[title].histo( dqm()->bookProfile( title, title, // name and title 00060 nBins, LOWBIN, HIGHBIN, // binning + range 00061 100, 0., -1.,"s" ) ); // Y range : automatic 00062 dqm()->setCurrentFolder( pwd ); 00063 00064 timingMap_[title].vNumOfEntries_.resize(nBins,0); 00065 timingMap_[title].vSumOfContents_.resize(nBins,0); 00066 timingMap_[title].vSumOfSquares_.resize(nBins,0); 00067 } 00068 timing_ = &(timingMap_[title]); 00069 // same histo at the partition level 00070 title = SiStripHistoTitle( sistrip::EXPERT_HISTO, 00071 sistrip::APV_LATENCY, 00072 sistrip::DET_KEY, 00073 int(SiStripDetId(connection().detId()).subDetector()), 00074 sistrip::PARTITION, 00075 0, 00076 sistrip::extrainfo::clusterCharge_).title(); 00077 // look if such an histogram is already booked 00078 if(timingMap_.find(title)!=timingMap_.end()) { 00079 // if already booked, use it 00080 LogDebug("Commissioning") << "[LatencyTask::book] using existing histogram."; 00081 } else { 00082 // if not, book it 00083 timingMap_[title] = HistoSet(); 00084 int nBins = NBINS; 00085 LogDebug("Commissioning") << "[LatencyTask::book] booking a new histogram in " << dqm()->pwd(); 00086 timingMap_[title].histo( dqm()->bookProfile( title, title, // name and title 00087 nBins, LOWBIN, HIGHBIN, // binning + range 00088 100, 0., -1.,"s" ) ); // Y range : automatic 00089 00090 timingMap_[title].vNumOfEntries_.resize(nBins,0); 00091 timingMap_[title].vSumOfContents_.resize(nBins,0); 00092 timingMap_[title].vSumOfSquares_.resize(nBins,0); 00093 } 00094 timingPartition_ = &(timingMap_[title]); 00095 // construct the histo title 00096 // by setting the granularity to sistrip::TRACKER, the title will be identical for all detkeys. 00097 // therefore, only one histo will be booked/analyzed 00098 title = SiStripHistoTitle( sistrip::EXPERT_HISTO, 00099 sistrip::APV_LATENCY, 00100 sistrip::DET_KEY, 00101 0, 00102 sistrip::TRACKER, 00103 0, 00104 sistrip::extrainfo::occupancy_).title(); 00105 // look if such an histogram is already booked 00106 if(clusterMap_.find(title)!=clusterMap_.end()) { 00107 // if already booked, use it 00108 LogDebug("Commissioning") << "[LatencyTask::book] using existing histogram."; 00109 } else { 00110 // if not, book it 00111 clusterMap_[title] = HistoSet(); 00112 int nBins = NBINS; 00113 std::string pwd = dqm()->pwd(); 00114 std::string rootDir = pwd.substr(0,pwd.find(sistrip::root_ + "/")+sistrip::root_.size()); 00115 rootDir += "/"; rootDir += sistrip::controlView_; 00116 dqm()->setCurrentFolder( rootDir ); 00117 LogDebug("Commissioning") << "[LatencyTask::book] booking a new histogram in " << dqm()->pwd(); 00118 clusterMap_[title].histo( dqm()->book1D( title, title, // name and title 00119 nBins, LOWBIN, HIGHBIN )); // binning + range 00120 dqm()->setCurrentFolder( pwd ); 00121 00122 clusterMap_[title].isProfile_=false; 00123 clusterMap_[title].vNumOfEntries_.resize(nBins,0); 00124 clusterMap_[title].vSumOfContents_.resize(nBins,0); 00125 clusterMap_[title].vSumOfSquares_.resize(nBins,0); 00126 } 00127 cluster_ = &(clusterMap_[title]); 00128 // same histo at the partition level 00129 title = SiStripHistoTitle( sistrip::EXPERT_HISTO, 00130 sistrip::APV_LATENCY, 00131 sistrip::DET_KEY, 00132 int(SiStripDetId(connection().detId()).subDetector()), 00133 sistrip::PARTITION, 00134 0, 00135 sistrip::extrainfo::occupancy_).title(); 00136 // look if such an histogram is already booked 00137 if(clusterMap_.find(title)!=clusterMap_.end()) { 00138 // if already booked, use it 00139 LogDebug("Commissioning") << "[LatencyTask::book] using existing histogram."; 00140 } else { 00141 // if not, book it 00142 clusterMap_[title] = HistoSet(); 00143 int nBins = NBINS; 00144 LogDebug("Commissioning") << "[LatencyTask::book] booking a new histogram in " << dqm()->pwd(); 00145 clusterMap_[title].histo( dqm()->book1D( title, title, // name and title 00146 nBins, LOWBIN, HIGHBIN )); // binning + range 00147 00148 clusterMap_[title].isProfile_=false; 00149 clusterMap_[title].vNumOfEntries_.resize(nBins,0); 00150 clusterMap_[title].vSumOfContents_.resize(nBins,0); 00151 clusterMap_[title].vSumOfSquares_.resize(nBins,0); 00152 } 00153 clusterPartition_ = &(clusterMap_[title]); 00154 00155 LogDebug("Commissioning") << "[LatencyTask::book] done"; 00156 }
void LatencyTask::fill | ( | const SiStripEventSummary & | summary, | |
const edm::DetSet< SiStripRawDigi > & | digis | |||
) | [private, virtual] |
Reimplemented from CommissioningTask.
Definition at line 160 of file LatencyTask.cc.
References cluster_, clusterPartition_, edm::DetSet< T >::data, firstReading_, HIGHBIN, int, LogDebug, LOWBIN, NBINS, strip(), timing_, timingPartition_, and CommissioningTask::updateHistoSet().
00161 { 00162 LogDebug("Commissioning") << "[LatencyTask::fill]"; 00163 // retrieve the delay from the EventSummary 00164 int32_t delay = static_cast<int32_t>( const_cast<SiStripEventSummary&>(summary).latency() ); 00165 if(firstReading_==-1) firstReading_ = delay; 00166 float correctedDelay = 0.; 00167 LogDebug("Commissioning") << "[LatencyTask::fill]; the delay is " << delay; 00168 // loop on the strips to find the (maybe) non-zero digi 00169 unsigned int nclusters = 0; 00170 for(unsigned int strip=0;strip<digis.data.size();strip++) { 00171 if(digis.data[strip].adc()!=0) { 00172 // count the "cluster" 00173 ++nclusters; 00174 // no TOF correction is applied. 00175 // 2 reasons: the effect is a priori to thin to be seen with 25ns steps 00176 // and it biases the result by one clock due to the 25bins in the HistoSet 00177 correctedDelay = delay*(-25.); // no TOF correction is applied. 00178 // compute the bin 00179 int bin = int((correctedDelay-LOWBIN)/((HIGHBIN-LOWBIN)/NBINS)); 00180 LogDebug("Commissioning") << "[LatencyTask::fill]; using a hit with value " << ( digis.data[strip].adc()&0xff ) 00181 << " at corrected delay of " << correctedDelay 00182 << " in bin " << bin ; 00183 updateHistoSet( *timing_,bin,digis.data[strip].adc()&0xff); 00184 updateHistoSet( *timingPartition_,bin,digis.data[strip].adc()&0xff); 00185 } 00186 } 00187 // set the occupancy 00188 int bin = int((delay*(-25.)-LOWBIN)/((HIGHBIN-LOWBIN)/NBINS)); 00189 LogDebug("Commissioning") << "[LatencyTask::fill]; occupancy is " << nclusters; 00190 updateHistoSet( *cluster_,bin,nclusters ); 00191 updateHistoSet( *clusterPartition_,bin,nclusters ); 00192 }
void LatencyTask::update | ( | ) | [private, virtual] |
Reimplemented from CommissioningTask.
Definition at line 196 of file LatencyTask.cc.
References cluster_, clusterPartition_, LogDebug, timing_, timingPartition_, and CommissioningTask::updateHistoSet().
00196 { 00197 LogDebug("Commissioning") << "[LatencyTask::update]"; 00198 updateHistoSet( *timing_ ); 00199 updateHistoSet( *timingPartition_ ); 00200 updateHistoSet( *cluster_ ); 00201 updateHistoSet( *clusterPartition_ ); 00202 }
HistoSet* LatencyTask::cluster_ [private] |
std::map< std::string, CommissioningTask::HistoSet > LatencyTask::clusterMap_ [static, private] |
HistoSet* LatencyTask::clusterPartition_ [private] |
int LatencyTask::firstReading_ [private] |
HistoSet* LatencyTask::timing_ [private] |
std::map< std::string, CommissioningTask::HistoSet > LatencyTask::timingMap_ [static, private] |
HistoSet* LatencyTask::timingPartition_ [private] |