CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 &)
 
virtual ~FineDelayTask ()
 
- 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 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

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

Static Private Attributes

static MonitorElementmode_ = NULL
 
static HistoSet timing_
 

Additional Inherited Members

- 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 ( DQMStore dqm,
const FedChannelConnection conn 
)

Definition at line 20 of file FineDelayTask.cc.

References LogDebug.

21  :
22  CommissioningTask( dqm, conn, "FineDelayTask" )
23 {
24  LogDebug("Commissioning") << "[FineDelayTask::FineDelayTask] Constructing object...";
25 }
#define LogDebug(id)
FineDelayTask::~FineDelayTask ( )
virtual

Definition at line 29 of file FineDelayTask.cc.

References LogDebug.

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

Member Function Documentation

void FineDelayTask::book ( )
privatevirtual

Reimplemented from CommissioningTask.

Definition at line 35 of file FineDelayTask.cc.

References DQMStore::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, SiStripKey::path(), alignCSCRings::pwd, DQMStore::pwd(), sistrip::root_, DQMStore::setCurrentFolder(), AlCaHLTBitMon_QueryRunRegistry::string, timing_, indexGen::title, sistrip::TRACKER, CommissioningTask::HistoSet::vNumOfEntries_, CommissioningTask::HistoSet::vSumOfContents_, and CommissioningTask::HistoSet::vSumOfSquares_.

35  {
36  LogDebug("Commissioning") << "[FineDelayTask::book]";
37 
39  int nBins = NBINS;
40  SiStripDetKey detkeytracker((uint32_t) 0);
41 
42  // see if the global timing histogram is already booked
43  if (timing_.histo()) {
44  // if already booked, use it
45  LogDebug("Commissioning") << "[FineDelayTask::book] using existing histogram.";
46  } else {
47  // make a new histo on the tracker level if not existing yet
48  LogDebug("Commissioning") << "[LatencyTask::book] booking a new histogram.";
49  // construct the histo title
53  detkeytracker.key(),
55  0,
57  dqm()->setCurrentFolder( detkeytracker.path() );
58  timing_.histo( dqm()->bookProfile( title, title, // name and title
59  nBins, LOWBIN, HIGHBIN, // binning + range
60  100, 0., -1., "s" ) ); // Y range : automatic
61  timing_.vNumOfEntries_.resize(nBins,0);
62  timing_.vSumOfContents_.resize(nBins,0);
63  timing_.vSumOfSquares_.resize(nBins,0);
64  }
65  LogDebug("Commissioning") << "Binning is " << timing_.vNumOfEntries_.size();
66  LogDebug("Commissioning") << "[FineDelayTask::book] done";
67  if(!mode_) {
68  std::string pwd = dqm()->pwd();
69  std::string rootDir = pwd.substr(0,pwd.find(std::string(sistrip::root_) + "/")+(sizeof(sistrip::root_)));
70  dqm()->setCurrentFolder( rootDir );
71  mode_ = dqm()->bookInt("latencyCode");
72  }
73 
74 }
#define LogDebug(id)
std::vector< float > vNumOfEntries_
#define HIGHBIN
Utility class that holds histogram title.
std::vector< float > vSumOfContents_
#define LOWBIN
Definition: FineDelayTask.cc:9
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_[]
DQMStore *const dqm() const
#define NBINS
Definition: FineDelayTask.cc:8
void histo(MonitorElement *)
static const char root_[]
std::vector< double > vSumOfSquares_
static MonitorElement * mode_
Definition: FineDelayTask.h:26
MonitorElement * bookInt(const char *name)
Book int.
Definition: DQMStore.cc:849
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:655
static HistoSet timing_
Definition: FineDelayTask.h:25
const std::string & pwd(void) const
Definition: DQMStore.cc:627
void FineDelayTask::fill ( const SiStripEventSummary summary,
const edm::DetSet< SiStripRawDigi > &  digis 
)
privatevirtual

Reimplemented from CommissioningTask.

Definition at line 78 of file FineDelayTask.cc.

References newFWLiteAna::bin, edm::DetSet< T >::data, MonitorElement::Fill(), HIGHBIN, LogDebug, LOWBIN, mode_, NBINS, pileupCalc::nbins, edmLumisInFiles::summary, timing_, and CommissioningTask::updateHistoSet().

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

Reimplemented from CommissioningTask.

Definition at line 115 of file FineDelayTask.cc.

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

Referenced by progressbar.ProgressBar::__next__(), relval_steps.Matrix::__setitem__(), relval_steps.Steps::__setitem__(), Vispa.Gui.VispaWidget.VispaWidget::autosize(), Vispa.Views.LineDecayView.LineDecayContainer::createObject(), Vispa.Views.LineDecayView.LineDecayContainer::deselectAllObjects(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::deselectAllWidgets(), Vispa.Gui.VispaWidget.VispaWidget::enableAutosizing(), progressbar.ProgressBar::finish(), Vispa.Gui.MenuWidget.MenuWidget::leaveEvent(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::mouseMoveEvent(), Vispa.Gui.MenuWidget.MenuWidget::mouseMoveEvent(), Vispa.Views.LineDecayView.LineDecayContainer::mouseMoveEvent(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::mouseReleaseEvent(), Vispa.Views.LineDecayView.LineDecayContainer::objectMoved(), relval_steps.Steps::overwrite(), Vispa.Views.LineDecayView.LineDecayContainer::removeObject(), Vispa.Gui.ConnectableWidget.ConnectableWidget::removePorts(), Vispa.Gui.FindDialog.FindDialog::reset(), Vispa.Gui.PortConnection.PointToPointConnection::select(), Vispa.Gui.VispaWidget.VispaWidget::select(), Vispa.Views.LineDecayView.LineDecayContainer::select(), Vispa.Gui.VispaWidget.VispaWidget::setText(), Vispa.Gui.VispaWidget.VispaWidget::setTitle(), Vispa.Gui.ZoomableWidget.ZoomableWidget::setZoom(), Vispa.Views.LineDecayView.LineDecayContainer::setZoom(), and Vispa.Gui.PortConnection.PointToPointConnection::updateConnection().

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

Member Data Documentation

MonitorElement * FineDelayTask::mode_ = NULL
staticprivate

Definition at line 26 of file FineDelayTask.h.

Referenced by book(), and fill().

CommissioningTask::HistoSet FineDelayTask::timing_
staticprivate

Definition at line 25 of file FineDelayTask.h.

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