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 | Private Attributes
SiStripDCSStatus Class Reference

#include <SiStripDCSStatus.h>

Public Member Functions

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

Private Member Functions

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

Private Attributes

bool initialised
 
bool rawdataAbsent
 
bool statusTECB
 
bool statusTECF
 
bool statusTIBTID
 
bool statusTOB
 
bool TECBinDAQ
 
bool TECFinDAQ
 
bool TIBTIDinDAQ
 
bool TOBinDAQ
 
bool trackerAbsent
 

Detailed Description

Definition at line 7 of file SiStripDCSStatus.h.

Constructor & Destructor Documentation

SiStripDCSStatus::SiStripDCSStatus ( )

Definition at line 27 of file SiStripDCSStatus.cc.

27  :
28  TIBTIDinDAQ(false),
29  TOBinDAQ(false),
30  TECFinDAQ(false),
31  TECBinDAQ(false),
32  trackerAbsent(false),
33  rawdataAbsent(true),
34  initialised(false) {
35 }
SiStripDCSStatus::~SiStripDCSStatus ( )

Definition at line 39 of file SiStripDCSStatus.cc.

39  {
40 }

Member Function Documentation

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

Definition at line 44 of file SiStripDCSStatus.cc.

References edm::Event::getByLabel(), 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(), and SiStripDCSFilter::filter().

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

Definition at line 99 of file SiStripDCSStatus.cc.

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

Referenced by getStatus().

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

Member Data Documentation

bool SiStripDCSStatus::initialised
private

Definition at line 22 of file SiStripDCSStatus.h.

Referenced by getStatus(), and initialise().

bool SiStripDCSStatus::rawdataAbsent
private

Definition at line 21 of file SiStripDCSStatus.h.

Referenced by getStatus(), and initialise().

bool SiStripDCSStatus::statusTECB
private

Definition at line 19 of file SiStripDCSStatus.h.

Referenced by getStatus().

bool SiStripDCSStatus::statusTECF
private

Definition at line 19 of file SiStripDCSStatus.h.

Referenced by getStatus().

bool SiStripDCSStatus::statusTIBTID
private

Definition at line 19 of file SiStripDCSStatus.h.

Referenced by getStatus().

bool SiStripDCSStatus::statusTOB
private

Definition at line 19 of file SiStripDCSStatus.h.

Referenced by getStatus().

bool SiStripDCSStatus::TECBinDAQ
private

Definition at line 18 of file SiStripDCSStatus.h.

Referenced by getStatus(), and initialise().

bool SiStripDCSStatus::TECFinDAQ
private

Definition at line 18 of file SiStripDCSStatus.h.

Referenced by getStatus(), and initialise().

bool SiStripDCSStatus::TIBTIDinDAQ
private

Definition at line 18 of file SiStripDCSStatus.h.

Referenced by getStatus(), and initialise().

bool SiStripDCSStatus::TOBinDAQ
private

Definition at line 18 of file SiStripDCSStatus.h.

Referenced by getStatus(), and initialise().

bool SiStripDCSStatus::trackerAbsent
private

Definition at line 20 of file SiStripDCSStatus.h.

Referenced by getStatus(), and initialise().