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 (CompactHistoSet &)
 
void updateHistoSet (CompactHistoSet &, const uint32_t &bin)
 
void updateHistoSet (CompactHistoSet &, const uint32_t &bin, const short &value)
 
void updateHistoSet (HistoSet &)
 
void updateHistoSet (HistoSet &, const float &value)
 
void updateHistoSet (HistoSet &, const uint32_t &bin)
 
void updateHistoSet (HistoSet &, const uint32_t &bin, const float &value)
 

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.

19  : CommissioningTask(dqm, conn, "FineDelayTask") {
20  LogDebug("Commissioning") << "[FineDelayTask::FineDelayTask] Constructing object...";
21 }

References LogDebug.

◆ ~FineDelayTask()

FineDelayTask::~FineDelayTask ( )
override

Definition at line 25 of file FineDelayTask.cc.

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

References LogDebug.

Member Function Documentation

◆ book()

void FineDelayTask::book ( )
overrideprivatevirtual

Reimplemented from CommissioningTask.

Definition at line 29 of file FineDelayTask.cc.

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 }

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_.

◆ fill()

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

Reimplemented from CommissioningTask.

Definition at line 78 of file FineDelayTask.cc.

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 }

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

◆ update()

void FineDelayTask::update ( )
overrideprivatevirtual

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().

CommissioningTask::HistoSet::vSumOfSquares_
std::vector< double > vSumOfSquares_
Definition: CommissioningTask.h:46
runGCPTkAlMap.title
string title
Definition: runGCPTkAlMap.py:94
NBINS
#define NBINS
Definition: FineDelayTask.cc:7
CommissioningTask::HistoSet::vSumOfContents_
std::vector< float > vSumOfContents_
Definition: CommissioningTask.h:45
sistrip::TRACKER
Definition: ConstantsForGranularity.h:64
alignCSCRings.pwd
pwd
Definition: alignCSCRings.py:57
sistrip::DET_KEY
Definition: ConstantsForKeyType.h:32
digitizers_cfi.strip
strip
Definition: digitizers_cfi.py:19
SiStripCommissioningClient_cfg.conn
conn
Definition: SiStripCommissioningClient_cfg.py:5
CommissioningTask::HistoSet::vNumOfEntries_
std::vector< float > vNumOfEntries_
Definition: CommissioningTask.h:44
sistrip::FINE_DELAY
Definition: ConstantsForRunType.h:85
sistrip::extrainfo::clusterCharge_
static const char clusterCharge_[]
Definition: ConstantsForDqm.h:59
dqm::impl::MonitorElement::Fill
void Fill(long long x)
Definition: MonitorElement.h:290
sistrip::EXPERT_HISTO
Definition: ConstantsForHistoType.h:29
LaserClient_cfi.nbins
nbins
Definition: LaserClient_cfi.py:51
dqm::implementation::DQMStore::setCurrentFolder
void setCurrentFolder(std::string const &fullpath) override
Definition: DQMStore.h:569
seedmultiplicitymonitor_newtracking_cfi.nBins
nBins
Definition: seedmultiplicitymonitor_newtracking_cfi.py:8
CommissioningTask::CommissioningTask
CommissioningTask()
Definition: CommissioningTask.h:143
HIGHBIN
#define HIGHBIN
Definition: FineDelayTask.cc:9
dqm::implementation::DQMStore::pwd
std::string pwd() override
Definition: DQMStore.h:567
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:233
CommissioningTask::HistoSet::histo
void histo(MonitorElement *)
Definition: CommissioningTask.cc:89
dqm::implementation::IBooker::bookInt
MonitorElement * bookInt(TString const &name, FUNC onbooking=NOOP())
Definition: DQMStore.h:73
createfilelist.int
int
Definition: createfilelist.py:10
edmLumisInFiles.summary
summary
Definition: edmLumisInFiles.py:39
CommissioningTask::updateHistoSet
void updateHistoSet(HistoSet &, const uint32_t &bin, const float &value)
Definition: CommissioningTask.cc:274
sistrip::root_
static const char root_[]
Definition: ConstantsForDqm.h:30
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
newFWLiteAna.bin
bin
Definition: newFWLiteAna.py:161
SiStripDetKey
Utility class that identifies a position within the strip tracker geometrical structure,...
Definition: SiStripDetKey.h:28
CommissioningTask::dqm
DQMStore *const dqm() const
Definition: CommissioningTask.h:188
edm::DetSet::data
collection_type data
Definition: DetSet.h:80
SiStripHistoTitle
Utility class that holds histogram title.
Definition: SiStripHistoTitle.h:20
FineDelayTask::timing_
static HistoSet timing_
Definition: FineDelayTask.h:21
LOWBIN
#define LOWBIN
Definition: FineDelayTask.cc:8
FineDelayTask::mode_
static MonitorElement * mode_
Definition: FineDelayTask.h:22
phase2TrackerDigitizer_cfi.delay
delay
Definition: phase2TrackerDigitizer_cfi.py:49
dqm
Definition: DQMStore.h:18