CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Static Private Attributes
FineDelayTask Class Reference

#include <FineDelayTask.h>

Inheritance diagram for FineDelayTask:
CommissioningTask

Public Member Functions

 FineDelayTask (DQMStore *, const FedChannelConnection &)
 
 ~FineDelayTask () override
 
- Public Member Functions inherited from CommissioningTask
void bookHistograms ()
 
 CommissioningTask (DQMStore *, const FedChannelConnection &, const std::string &my_name)
 
void eventSetup (const edm::EventSetup *)
 
const uint32_t & fillCntr () const
 
void fillHistograms (const SiStripEventSummary &, const edm::DetSet< SiStripRawDigi > &)
 
void fillHistograms (const SiStripEventSummary &, const edm::DetSet< SiStripRawDigi > &, const edm::DetSet< SiStripRawDigi > &)
 
void fillHistograms (const SiStripEventSummary &, const edm::DetSet< SiStripRawDigi > &, const edm::DetSet< SiStripRawDigi > &, const std::vector< uint16_t > &)
 
void fillHistograms (const SiStripEventSummary &, const uint16_t &fed_id, const std::map< uint16_t, float > &fed_ch)
 
const std::string & myName () const
 
const uint32_t & updateFreq () const
 
void updateFreq (const uint32_t &)
 
void updateHistograms ()
 
virtual ~CommissioningTask ()
 

Private Member Functions

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

Static Private Attributes

static MonitorElementmode_ = nullptr
 
static HistoSet timing_
 

Additional Inherited Members

- Public Types inherited from CommissioningTask
typedef dqm::legacy::DQMStore DQMStore
 
typedef dqm::legacy::MonitorElement MonitorElement
 
- Protected Member Functions inherited from CommissioningTask
const FedChannelConnectionconnection () const
 
DQMStore *const dqm () const
 
const edm::EventSetup *const eventSetup () const
 
const uint32_t & fecKey () const
 
const uint32_t & fedKey () const
 
void updateHistoSet (HistoSet &, const uint32_t &bin, const float &value)
 
void updateHistoSet (CompactHistoSet &, const uint32_t &bin, const short &value)
 
void updateHistoSet (HistoSet &, const uint32_t &bin)
 
void updateHistoSet (CompactHistoSet &, const uint32_t &bin)
 
void updateHistoSet (HistoSet &, const float &value)
 
void updateHistoSet (CompactHistoSet &)
 
void updateHistoSet (HistoSet &)
 

Detailed Description

Definition at line 11 of file FineDelayTask.h.

Constructor & Destructor Documentation

◆ FineDelayTask()

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

Definition at line 18 of file FineDelayTask.cc.

References LogDebug.

19  : CommissioningTask(dqm, conn, "FineDelayTask") {
20  LogDebug("Commissioning") << "[FineDelayTask::FineDelayTask] Constructing object...";
21 }
conn
Definition: getInfo.py:9
Definition: DQMStore.h:18
#define LogDebug(id)

◆ ~FineDelayTask()

FineDelayTask::~FineDelayTask ( )
override

Definition at line 25 of file FineDelayTask.cc.

References LogDebug.

25 { LogDebug("Commissioning") << "[FineDelayTask::FineDelayTask] Destructing object..."; }
#define LogDebug(id)

Member Function Documentation

◆ book()

void FineDelayTask::book ( )
overrideprivatevirtual

Reimplemented from CommissioningTask.

Definition at line 29 of file FineDelayTask.cc.

References dqm::implementation::IBooker::bookInt(), sistrip::extrainfo::clusterCharge_, sistrip::DET_KEY, CommissioningTask::dqm(), sistrip::EXPERT_HISTO, sistrip::FINE_DELAY, HIGHBIN, CommissioningTask::HistoSet::histo(), SiStripKey::key(), LogDebug, LOWBIN, mode_, NBINS, seedmultiplicitymonitor_newtracking_cfi::nBins, SiStripKey::path(), alignCSCRings::pwd, dqm::implementation::DQMStore::pwd(), sistrip::root_, dqm::implementation::DQMStore::setCurrentFolder(), AlCaHLTBitMon_QueryRunRegistry::string, timing_, runGCPTkAlMap::title, sistrip::TRACKER, CommissioningTask::HistoSet::vNumOfEntries_, CommissioningTask::HistoSet::vSumOfContents_, and CommissioningTask::HistoSet::vSumOfSquares_.

29  {
30  LogDebug("Commissioning") << "[FineDelayTask::book]";
31 
33  int nBins = NBINS;
34  SiStripDetKey detkeytracker((uint32_t)0);
35 
36  // see if the global timing histogram is already booked
37  if (timing_.histo()) {
38  // if already booked, use it
39  LogDebug("Commissioning") << "[FineDelayTask::book] using existing histogram.";
40  } else {
41  // make a new histo on the tracker level if not existing yet
42  LogDebug("Commissioning") << "[LatencyTask::book] booking a new histogram.";
43  // construct the histo title
47  detkeytracker.key(),
49  0,
51  .title();
52  dqm()->setCurrentFolder(detkeytracker.path());
53  timing_.histo(dqm()->bookProfile(title,
54  title, // name and title
55  nBins,
56  LOWBIN,
57  HIGHBIN, // binning + range
58  100,
59  0.,
60  -1.,
61  "s")); // Y range : automatic
62  timing_.vNumOfEntries_.resize(nBins, 0);
63  timing_.vSumOfContents_.resize(nBins, 0);
64  timing_.vSumOfSquares_.resize(nBins, 0);
65  }
66  LogDebug("Commissioning") << "Binning is " << timing_.vNumOfEntries_.size();
67  LogDebug("Commissioning") << "[FineDelayTask::book] done";
68  if (!mode_) {
69  std::string pwd = dqm()->pwd();
70  std::string rootDir = pwd.substr(0, pwd.find(std::string(sistrip::root_) + "/") + (sizeof(sistrip::root_)));
71  dqm()->setCurrentFolder(rootDir);
72  mode_ = dqm()->bookInt("latencyCode");
73  }
74 }
std::vector< float > vNumOfEntries_
#define HIGHBIN
Definition: FineDelayTask.cc:9
Utility class that holds histogram title.
void setCurrentFolder(std::string const &fullpath) override
Definition: DQMStore.h:656
std::vector< float > vSumOfContents_
std::string pwd() override
Definition: DQMStore.h:654
#define LOWBIN
Definition: FineDelayTask.cc:8
DQMStore *const dqm() const
Utility class that identifies a position within the strip tracker geometrical structure, down to the level of an APV25 chip.
Definition: SiStripDetKey.h:28
static const char clusterCharge_[]
#define NBINS
Definition: FineDelayTask.cc:7
MonitorElement * bookInt(TString const &name, FUNC onbooking=NOOP())
Definition: DQMStore.h:73
static MonitorElement * mode_
Definition: FineDelayTask.h:22
void histo(MonitorElement *)
static const char root_[]
std::vector< double > vSumOfSquares_
static HistoSet timing_
Definition: FineDelayTask.h:21
#define LogDebug(id)

◆ fill()

void FineDelayTask::fill ( const SiStripEventSummary summary,
const edm::DetSet< SiStripRawDigi > &  digis 
)
overrideprivatevirtual

Reimplemented from CommissioningTask.

Definition at line 78 of file FineDelayTask.cc.

References newFWLiteAna::bin, edm::DetSet< T >::data, phase2TrackerDigitizer_cfi::delay, dqm::impl::MonitorElement::Fill(), HIGHBIN, createfilelist::int, LogDebug, LOWBIN, mode_, NBINS, LaserClient_cfi::nbins, nano_mu_digi_cff::strip, edmLumisInFiles::summary, timing_, and CommissioningTask::updateHistoSet().

78  {
79  LogDebug("Commissioning") << "[FineDelayTask::fill]";
80  // retrieve the delay from the EventSummary
81  float delay = summary.ttcrx();
82  uint32_t latencyCode = (summary.layerScanned() >> 24) & 0xff;
83  LogDebug("Commissioning") << "[FineDelayTask::fill]: layerScanned() is " << summary.layerScanned();
84  int latencyShift =
85  latencyCode & 0x3f; // number of bunch crossings between current value and start of scan... must be positive
86  if (latencyShift > 32)
87  latencyShift -= 64; // allow negative values: we cover [-32,32].. should not be needed.
88  if ((latencyCode >> 6) == 2)
89  latencyShift -= 3; // layer in deconv, rest in peak
90  if ((latencyCode >> 6) == 1)
91  latencyShift += 3; // layer in peak, rest in deconv
92  float correctedDelay =
93  delay - (latencyShift * 25.); // shifts the delay so that 0 corresponds to the current settings.
94 
95  LogDebug("Commissioning") << "[FineDelayTask::fill]; the delay is " << delay;
96  // loop on the strips to find the (maybe) non-zero digi
97  for (unsigned int strip = 0; strip < digis.data.size(); strip++) {
98  if (digis.data[strip].adc() != 0) {
99  // apply the TOF correction
100  float tof = (digis.data[strip].adc() >> 8) / 10.;
101  correctedDelay = delay - (latencyShift * 25.) - tof;
102  if ((digis.data[strip].adc() >> 8) == 255)
103  continue; // skip hit if TOF is in overflow
104  // compute the bin
105  float nbins = NBINS;
106  float lowbin = LOWBIN;
107  float highbin = HIGHBIN;
108  int bin = int((correctedDelay - lowbin) / ((highbin - lowbin) / nbins));
109  LogDebug("Commissioning") << "[FineDelayTask::fill]; using a hit with value " << (digis.data[strip].adc() & 0xff)
110  << " at corrected delay of " << correctedDelay << " in bin " << bin << " (tof is "
111  << tof << "( since adc = " << digis.data[strip].adc() << "))";
112  updateHistoSet(timing_, bin, digis.data[strip].adc() & 0xff);
113  if (mode_)
114  mode_->Fill(latencyCode);
115  }
116  }
117 }
#define HIGHBIN
Definition: FineDelayTask.cc:9
void Fill(long long x)
#define LOWBIN
Definition: FineDelayTask.cc:8
void updateHistoSet(HistoSet &, const uint32_t &bin, const float &value)
#define NBINS
Definition: FineDelayTask.cc:7
static MonitorElement * mode_
Definition: FineDelayTask.h:22
collection_type data
Definition: DetSet.h:80
static HistoSet timing_
Definition: FineDelayTask.h:21
#define LogDebug(id)

◆ update()

void FineDelayTask::update ( )
overrideprivatevirtual

Reimplemented from CommissioningTask.

Definition at line 121 of file FineDelayTask.cc.

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

Referenced by progressbar.ProgressBar::__next__(), MatrixUtil.Matrix::__setitem__(), MatrixUtil.Steps::__setitem__(), dqm-mbProfile.Profile::finish(), progressbar.ProgressBar::finish(), and MatrixUtil.Steps::overwrite().

121  {
122  LogDebug("Commissioning") << "[FineDelayTask::update]";
124 }
void updateHistoSet(HistoSet &, const uint32_t &bin, const float &value)
static HistoSet timing_
Definition: FineDelayTask.h:21
#define LogDebug(id)

Member Data Documentation

◆ mode_

CommissioningTask::MonitorElement * FineDelayTask::mode_ = nullptr
staticprivate

Definition at line 22 of file FineDelayTask.h.

Referenced by book(), and fill().

◆ timing_

CommissioningTask::HistoSet FineDelayTask::timing_
staticprivate

Definition at line 21 of file FineDelayTask.h.

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