CMS 3D CMS Logo

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

#include <SiStripDCSStatus.h>

Public Member Functions

bool getStatus (edm::Event const &e, edm::EventSetup const &eSetup)
 
 SiStripDCSStatus (edm::ConsumesCollector &&iC)
 
 SiStripDCSStatus (edm::ConsumesCollector &iC)
 

Private Member Functions

void initialise (edm::Event const &e, edm::EventSetup const &eSetup)
 

Private Attributes

edm::EDGetTokenT< DCSRecorddcsRecordToken_
 
edm::EDGetTokenT< DcsStatusCollectiondcsStatusToken_
 
edm::ESGetToken< SiStripFedCabling, SiStripFedCablingRcdfedCablingToken_
 
bool initialised
 
bool rawdataAbsent
 
edm::EDGetTokenT< FEDRawDataCollectionrawDataToken_
 
bool TECBinDAQ
 
bool TECFinDAQ
 
bool TIBTIDinDAQ
 
bool TOBinDAQ
 
bool trackerAbsent
 
edm::ESGetToken< TrackerTopology, TrackerTopologyRcdtTopoToken_
 

Detailed Description

Definition at line 19 of file SiStripDCSStatus.h.

Constructor & Destructor Documentation

◆ SiStripDCSStatus() [1/2]

SiStripDCSStatus::SiStripDCSStatus ( edm::ConsumesCollector &&  iC)
inline

Definition at line 21 of file SiStripDCSStatus.h.

21 : SiStripDCSStatus(iC){};
SiStripDCSStatus(edm::ConsumesCollector &&iC)

◆ SiStripDCSStatus() [2/2]

SiStripDCSStatus::SiStripDCSStatus ( edm::ConsumesCollector iC)

Definition at line 24 of file SiStripDCSStatus.cc.

References edm::ConsumesCollector::consumes(), dcsRecordToken_, dcsStatusToken_, edm::ConsumesCollector::esConsumes(), fedCablingToken_, HLT_2022v15_cff::InputTag, rawDataToken_, and tTopoToken_.

25  : TIBTIDinDAQ(false),
26  TOBinDAQ(false),
27  TECFinDAQ(false),
28  TECBinDAQ(false),
29  trackerAbsent(false),
30  rawdataAbsent(true),
31  initialised(false) {
32  dcsStatusToken_ = iC.consumes<DcsStatusCollection>(edm::InputTag("scalersRawToDigi"));
33  dcsRecordToken_ = iC.consumes<DCSRecord>(edm::InputTag("onlineMetaDataDigis"));
34  rawDataToken_ = iC.consumes<FEDRawDataCollection>(edm::InputTag("rawDataCollector"));
37 }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > tTopoToken_
Class to contain DCS information from soft FED 1022.
Definition: DCSRecord.h:20
edm::EDGetTokenT< FEDRawDataCollection > rawDataToken_
edm::EDGetTokenT< DCSRecord > dcsRecordToken_
edm::ESGetToken< SiStripFedCabling, SiStripFedCablingRcd > fedCablingToken_
std::vector< DcsStatus > DcsStatusCollection
Definition: DcsStatus.h:110
Contains cabling info at the device level, including DetId, APV pair numbers, hardware addresses...
edm::EDGetTokenT< DcsStatusCollection > dcsStatusToken_

Member Function Documentation

◆ getStatus()

bool SiStripDCSStatus::getStatus ( edm::Event const &  e,
edm::EventSetup const &  eSetup 
)

Definition at line 41 of file SiStripDCSStatus.cc.

References DQMOffline_cff::dcsRecord, dcsRecordToken_, dcsStatusToken_, MillePedeFileConverter_cfg::e, initialise(), initialised, edm::HandleBase::isValid(), LogDebug, rawdataAbsent, TECBinDAQ, TECFinDAQ, DetStateFilter::TECm, DcsStatus::TECm, DetStateFilter::TECp, DcsStatus::TECp, DetStateFilter::TIBTID, DcsStatus::TIBTID, TIBTIDinDAQ, SectorBuilder_Tob_cff::TOB, DcsStatus::TOB, TOBinDAQ, and trackerAbsent.

Referenced by SiStripMonitorDigi::analyze(), SiStripMonitorCluster::analyze(), SiStripMonitorTrack::analyze(), and SiStripDCSFilter::filter().

41  {
42  bool retVal = true;
43  if (!initialised)
44  initialise(e, eSetup);
45 
47  e.getByToken(dcsStatusToken_, dcsStatus);
48 
50  e.getByToken(dcsRecordToken_, dcsRecord);
51 
52  bool statusTIBTID(true), statusTOB(true), statusTECF(true), statusTECB(true);
53  bool dcsTIBTID(true), dcsTOB(true), dcsTECF(true), dcsTECB(true);
54 
55  if (trackerAbsent || (!dcsStatus.isValid() && !dcsRecord.isValid())) {
56  return retVal;
57  }
58 
59  if ((*dcsStatus).empty()) {
60  if (e.eventAuxiliary().isRealData()) {
61  dcsTIBTID = (*dcsRecord).highVoltageReady(DCSRecord::Partition::TIBTID);
62  dcsTOB = (*dcsRecord).highVoltageReady(DCSRecord::Partition::TOB);
63  dcsTECF = (*dcsRecord).highVoltageReady(DCSRecord::Partition::TECp);
64  dcsTECB = (*dcsRecord).highVoltageReady(DCSRecord::Partition::TECm);
65  } else {
66  return retVal;
67  }
68  } else {
69  dcsTIBTID = ((*dcsStatus)[0].ready(DcsStatus::TIBTID));
70  dcsTOB = ((*dcsStatus)[0].ready(DcsStatus::TOB));
71  dcsTECF = ((*dcsStatus)[0].ready(DcsStatus::TECp));
72  dcsTECB = ((*dcsStatus)[0].ready(DcsStatus::TECm));
73  }
74 
75  if (rawdataAbsent) {
76  statusTIBTID = dcsTIBTID;
77  statusTOB = dcsTOB;
78  statusTECF = dcsTECF;
79  statusTECB = dcsTECB;
80  } else {
81  if (TIBTIDinDAQ && !dcsTIBTID)
82  statusTIBTID = false;
83  if (TOBinDAQ && !dcsTOB)
84  statusTOB = false;
85  if (TECFinDAQ && !dcsTECF)
86  statusTECF = false;
87  if (TECBinDAQ && !dcsTECB)
88  statusTECB = false;
89  }
90 
91  LogDebug("SiStripDCSStatus") << " SiStripDCSStatus :: Detectors in DAQ (TIBTID, TOB, TEC+ TEC-)" << TIBTIDinDAQ << " "
92  << TOBinDAQ << " " << TECFinDAQ << " " << TECBinDAQ << std::endl;
93  LogDebug("SiStripDCSStatus") << " SiStripDCSStatus :: Detectors in ON (TIBTID, TOB, TEC+ TEC-)" << dcsTIBTID << " "
94  << dcsTOB << " " << dcsTECF << " " << dcsTECB << std::endl;
95 
96  LogDebug("SiStripDCSStatus") << " SiStripDCSStatus :: Final Flags (TIBTID, TOB, TEC+ TEC-)" << statusTIBTID << " "
97  << statusTOB << " " << statusTECF << " " << statusTECB << std::endl;
98  if (statusTIBTID && statusTOB && statusTECF && statusTECB)
99  retVal = true;
100  else
101  retVal = false;
102  LogDebug("SiStripDCSStatus") << " Return Value " << retVal;
103  return retVal;
104 }
edm::EDGetTokenT< DCSRecord > dcsRecordToken_
void initialise(edm::Event const &e, edm::EventSetup const &eSetup)
bool isValid() const
Definition: HandleBase.h:70
edm::EDGetTokenT< DcsStatusCollection > dcsStatusToken_
#define LogDebug(id)

◆ initialise()

void SiStripDCSStatus::initialise ( edm::Event const &  e,
edm::EventSetup const &  eSetup 
)
private

Definition at line 108 of file SiStripDCSStatus.cc.

References FEDRawData::data(), MillePedeFileConverter_cfg::e, fedCablingToken_, FEDRawDataCollection::FEDData(), edm::EventSetup::getData(), initialised, edm::HandleBase::isValid(), rawdataAbsent, rawDataToken_, FEDRawData::size(), DetId::subdetId(), StripSubdetector::TEC, TECBinDAQ, TECFinDAQ, StripSubdetector::TIB, TIBTIDinDAQ, StripSubdetector::TID, StripSubdetector::TOB, TOBinDAQ, trackerAbsent, and tTopoToken_.

Referenced by getStatus().

108  {
109  //Retrieve tracker topology from geometry
110  const auto& tTopo = eSetup.getData(tTopoToken_);
111  const auto& fedCabling_ = eSetup.getData(fedCablingToken_);
112 
113  auto connectedFEDs = fedCabling_.fedIds();
114 
115  edm::Handle<FEDRawDataCollection> rawDataHandle;
116  // e.getByLabel("source", rawDataHandle);
117  e.getByToken(rawDataToken_, rawDataHandle);
118 
119  if (!rawDataHandle.isValid()) {
120  rawdataAbsent = true;
121  return;
122  }
123 
124  rawdataAbsent = false;
125  const FEDRawDataCollection& rawDataCollection = *rawDataHandle;
126  for (std::vector<unsigned short>::const_iterator ifed = connectedFEDs.begin(); ifed != connectedFEDs.end(); ifed++) {
127  auto fedChannels = fedCabling_.fedConnections(*ifed);
128  if (!(rawDataCollection.FEDData(*ifed).size()) || !(rawDataCollection.FEDData(*ifed).data()))
129  continue;
130  // Check Modules Connected
131  for (std::vector<FedChannelConnection>::const_iterator iconn = fedChannels.begin(); iconn < fedChannels.end();
132  iconn++) {
133  if (!iconn->isConnected())
134  continue;
135  uint32_t detId = iconn->detId();
136  StripSubdetector subdet(detId);
137  if ((subdet.subdetId() == StripSubdetector::TIB) || (subdet.subdetId() == StripSubdetector::TID)) {
138  TIBTIDinDAQ = true;
139  break;
140  } else if (subdet.subdetId() == StripSubdetector::TOB) {
141  TOBinDAQ = true;
142  break;
143  } else if (subdet.subdetId() == StripSubdetector::TEC) {
144  if (tTopo.tecSide(detId) == 2)
145  TECFinDAQ = true;
146  else if (tTopo.tecSide(detId) == 1)
147  TECBinDAQ = true;
148  break;
149  }
150  }
152  break;
153  }
154  initialised = true;
155  if (!TIBTIDinDAQ && !TOBinDAQ && !TECFinDAQ && !TECBinDAQ)
156  trackerAbsent = true;
157 }
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > tTopoToken_
static constexpr auto TEC
size_t size() const
Lenght of the data buffer in bytes.
Definition: FEDRawData.h:45
edm::EDGetTokenT< FEDRawDataCollection > rawDataToken_
edm::ESGetToken< SiStripFedCabling, SiStripFedCablingRcd > fedCablingToken_
static constexpr auto TOB
const FEDRawData & FEDData(int fedid) const
retrieve data for fed
static constexpr auto TIB
bool isValid() const
Definition: HandleBase.h:70
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
Definition: FEDRawData.cc:24
static constexpr auto TID

Member Data Documentation

◆ dcsRecordToken_

edm::EDGetTokenT<DCSRecord> SiStripDCSStatus::dcsRecordToken_
private

Definition at line 36 of file SiStripDCSStatus.h.

Referenced by getStatus(), and SiStripDCSStatus().

◆ dcsStatusToken_

edm::EDGetTokenT<DcsStatusCollection> SiStripDCSStatus::dcsStatusToken_
private

Definition at line 34 of file SiStripDCSStatus.h.

Referenced by getStatus(), and SiStripDCSStatus().

◆ fedCablingToken_

edm::ESGetToken<SiStripFedCabling, SiStripFedCablingRcd> SiStripDCSStatus::fedCablingToken_
private

Definition at line 38 of file SiStripDCSStatus.h.

Referenced by initialise(), and SiStripDCSStatus().

◆ initialised

bool SiStripDCSStatus::initialised
private

Definition at line 32 of file SiStripDCSStatus.h.

Referenced by getStatus(), and initialise().

◆ rawdataAbsent

bool SiStripDCSStatus::rawdataAbsent
private

Definition at line 31 of file SiStripDCSStatus.h.

Referenced by getStatus(), and initialise().

◆ rawDataToken_

edm::EDGetTokenT<FEDRawDataCollection> SiStripDCSStatus::rawDataToken_
private

Definition at line 35 of file SiStripDCSStatus.h.

Referenced by initialise(), and SiStripDCSStatus().

◆ TECBinDAQ

bool SiStripDCSStatus::TECBinDAQ
private

Definition at line 29 of file SiStripDCSStatus.h.

Referenced by getStatus(), and initialise().

◆ TECFinDAQ

bool SiStripDCSStatus::TECFinDAQ
private

Definition at line 29 of file SiStripDCSStatus.h.

Referenced by getStatus(), and initialise().

◆ TIBTIDinDAQ

bool SiStripDCSStatus::TIBTIDinDAQ
private

Definition at line 29 of file SiStripDCSStatus.h.

Referenced by getStatus(), and initialise().

◆ TOBinDAQ

bool SiStripDCSStatus::TOBinDAQ
private

Definition at line 29 of file SiStripDCSStatus.h.

Referenced by getStatus(), and initialise().

◆ trackerAbsent

bool SiStripDCSStatus::trackerAbsent
private

Definition at line 30 of file SiStripDCSStatus.h.

Referenced by getStatus(), and initialise().

◆ tTopoToken_

edm::ESGetToken<TrackerTopology, TrackerTopologyRcd> SiStripDCSStatus::tTopoToken_
private

Definition at line 37 of file SiStripDCSStatus.h.

Referenced by initialise(), and SiStripDCSStatus().