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)
 
 ~SiStripDCSStatus ()
 

Private Member Functions

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

Private Attributes

edm::EDGetTokenT< DcsStatusCollectiondcsStatusToken_
 
bool initialised
 
bool rawdataAbsent
 
edm::EDGetTokenT< FEDRawDataCollectionrawDataToken_
 
bool statusTECB
 
bool statusTECF
 
bool statusTIBTID
 
bool statusTOB
 
bool TECBinDAQ
 
bool TECFinDAQ
 
bool TIBTIDinDAQ
 
bool TOBinDAQ
 
bool trackerAbsent
 

Detailed Description

Definition at line 13 of file SiStripDCSStatus.h.

Constructor & Destructor Documentation

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

Definition at line 15 of file SiStripDCSStatus.h.

References MillePedeFileConverter_cfg::e, getStatus(), initialise(), and ~SiStripDCSStatus().

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

Definition at line 25 of file SiStripDCSStatus.cc.

References edm::ConsumesCollector::consumes(), dcsStatusToken_, and rawDataToken_.

25  :
26  TIBTIDinDAQ(false),
27  TOBinDAQ(false),
28  TECFinDAQ(false),
29  TECBinDAQ(false),
30  trackerAbsent(false),
31  rawdataAbsent(true),
32  initialised(false) {
33 
34  dcsStatusToken_ = iC.consumes<DcsStatusCollection>(edm::InputTag("scalersRawToDigi"));
35  rawDataToken_ = iC.consumes<FEDRawDataCollection>(edm::InputTag("rawDataCollector"));
36 }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
edm::EDGetTokenT< FEDRawDataCollection > rawDataToken_
std::vector< DcsStatus > DcsStatusCollection
Definition: DcsStatus.h:116
edm::EDGetTokenT< DcsStatusCollection > dcsStatusToken_
SiStripDCSStatus::~SiStripDCSStatus ( )

Definition at line 40 of file SiStripDCSStatus.cc.

Referenced by SiStripDCSStatus().

40  {
41 }

Member Function Documentation

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

Definition at line 45 of file SiStripDCSStatus.cc.

References dcsStatusToken_, edm::Event::getByToken(), initialise(), initialised, edm::HandleBase::isValid(), LogDebug, rawdataAbsent, statusTECB, statusTECF, statusTIBTID, statusTOB, TECBinDAQ, TECFinDAQ, DcsStatus::TECm, DcsStatus::TECp, DcsStatus::TIBTID, TIBTIDinDAQ, DcsStatus::TOB, TOBinDAQ, and trackerAbsent.

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

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

Definition at line 101 of file SiStripDCSStatus.cc.

References FEDRawData::data(), SiStripFedCabling::fedConnections(), FEDRawDataCollection::FEDData(), SiStripFedCabling::fedIds(), edm::EventSetup::get(), edm::Event::getByToken(), initialised, edm::HandleBase::isValid(), edm::ESHandle< T >::product(), rawdataAbsent, rawDataToken_, FEDRawData::size(), DetId::subdetId(), StripSubdetector::TEC, TECBinDAQ, TECFinDAQ, TrackerTopology::tecSide(), StripSubdetector::TIB, TIBTIDinDAQ, StripSubdetector::TID, StripSubdetector::TOB, TOBinDAQ, and trackerAbsent.

Referenced by getStatus(), and SiStripDCSStatus().

101  {
102  //Retrieve tracker topology from geometry
103  edm::ESHandle<TrackerTopology> tTopoHandle;
104  eSetup.get<TrackerTopologyRcd>().get(tTopoHandle);
105  const TrackerTopology* const tTopo = tTopoHandle.product();
106 
108  eSetup.get<SiStripFedCablingRcd>().get(fedCabling_);
109  auto connectedFEDs = fedCabling_->fedIds();
110 
111  edm::Handle<FEDRawDataCollection> rawDataHandle;
112  // e.getByLabel("source", rawDataHandle);
113  e.getByToken(rawDataToken_, rawDataHandle);
114 
115  if ( !rawDataHandle.isValid() ) {
116  rawdataAbsent = true;
117  return;
118  }
119 
120  rawdataAbsent = false;
121  const FEDRawDataCollection& rawDataCollection = *rawDataHandle;
122  for(std::vector<unsigned short>::const_iterator ifed = connectedFEDs.begin(); ifed != connectedFEDs.end(); ifed++){
123  auto fedChannels = fedCabling_->fedConnections( *ifed );
124  if (!(rawDataCollection.FEDData(*ifed).size()) || !(rawDataCollection.FEDData(*ifed).data()) ) continue;
125  // Check Modules Connected
126  for (std::vector<FedChannelConnection>::const_iterator iconn = fedChannels.begin();
127  iconn < fedChannels.end(); iconn++){
128  if (!iconn->isConnected()) continue;
129  uint32_t detId = iconn->detId();
130  StripSubdetector subdet(detId);
131  if ( (subdet.subdetId() == StripSubdetector::TIB) || (subdet.subdetId() == StripSubdetector::TID)) {
132  TIBTIDinDAQ = true;
133  break;
134  } else if (subdet.subdetId() == StripSubdetector::TOB) {
135  TOBinDAQ = true;
136  break;
137  } else if (subdet.subdetId() == StripSubdetector::TEC) {
138  if (tTopo->tecSide(detId) == 2) TECFinDAQ = true;
139  else if (tTopo->tecSide(detId) == 1) TECBinDAQ = true;
140  break;
141  }
142  }
143  if (TIBTIDinDAQ && TOBinDAQ && TECFinDAQ && TECBinDAQ) break;
144  }
145  initialised = true;
146  if (!TIBTIDinDAQ && !TOBinDAQ && !TECFinDAQ && !TECBinDAQ) trackerAbsent = true;
147 }
edm::EDGetTokenT< FEDRawDataCollection > rawDataToken_
size_t size() const
Lenght of the data buffer in bytes.
Definition: FEDRawData.h:47
const FEDRawData & FEDData(int fedid) const
retrieve data for fed
FedsConstIterRange fedIds() const
bool isValid() const
Definition: HandleBase.h:74
ConnsConstIterRange fedConnections(uint16_t fed_id) const
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
Definition: FEDRawData.cc:28
T const * product() const
Definition: ESHandle.h:86
unsigned int tecSide(const DetId &id) const

Member Data Documentation

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

Definition at line 31 of file SiStripDCSStatus.h.

Referenced by getStatus(), and SiStripDCSStatus().

bool SiStripDCSStatus::initialised
private

Definition at line 29 of file SiStripDCSStatus.h.

Referenced by getStatus(), and initialise().

bool SiStripDCSStatus::rawdataAbsent
private

Definition at line 28 of file SiStripDCSStatus.h.

Referenced by getStatus(), and initialise().

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

Definition at line 32 of file SiStripDCSStatus.h.

Referenced by initialise(), and SiStripDCSStatus().

bool SiStripDCSStatus::statusTECB
private

Definition at line 26 of file SiStripDCSStatus.h.

Referenced by getStatus().

bool SiStripDCSStatus::statusTECF
private

Definition at line 26 of file SiStripDCSStatus.h.

Referenced by getStatus().

bool SiStripDCSStatus::statusTIBTID
private

Definition at line 26 of file SiStripDCSStatus.h.

Referenced by getStatus().

bool SiStripDCSStatus::statusTOB
private

Definition at line 26 of file SiStripDCSStatus.h.

Referenced by getStatus().

bool SiStripDCSStatus::TECBinDAQ
private

Definition at line 25 of file SiStripDCSStatus.h.

Referenced by getStatus(), and initialise().

bool SiStripDCSStatus::TECFinDAQ
private

Definition at line 25 of file SiStripDCSStatus.h.

Referenced by getStatus(), and initialise().

bool SiStripDCSStatus::TIBTIDinDAQ
private

Definition at line 25 of file SiStripDCSStatus.h.

Referenced by getStatus(), and initialise().

bool SiStripDCSStatus::TOBinDAQ
private

Definition at line 25 of file SiStripDCSStatus.h.

Referenced by getStatus(), and initialise().

bool SiStripDCSStatus::trackerAbsent
private

Definition at line 27 of file SiStripDCSStatus.h.

Referenced by getStatus(), and initialise().