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 29 of file SiStripDCSStatus.cc.

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

Definition at line 41 of file SiStripDCSStatus.cc.

41  {
42 }

Member Function Documentation

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

Definition at line 46 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().

46  {
47 
48  bool retVal = true;
49  if (!initialised) initialise(e, eSetup);
50 
52  e.getByLabel("scalersRawToDigi", dcsStatus);
53  if ( trackerAbsent || !dcsStatus.isValid()) return retVal;
54  if ((*dcsStatus).size() == 0) 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: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 101 of file SiStripDCSStatus.cc.

References FEDRawData::data(), FEDRawDataCollection::FEDData(), edm::EventSetup::get(), edm::Event::getByLabel(), initialised, edm::HandleBase::isValid(), rawdataAbsent, TECDetId::side(), FEDRawData::size(), DetId::subdetId(), StripSubdetector::TEC, TECBinDAQ, TECFinDAQ, StripSubdetector::TIB, TIBTIDinDAQ, StripSubdetector::TID, StripSubdetector::TOB, TOBinDAQ, and trackerAbsent.

Referenced by getStatus().

101  {
102 
104  eSetup.get<SiStripFedCablingRcd>().get(fedCabling_);
105  const std::vector<uint16_t>& connectedFEDs = fedCabling_->feds();
106 
107  edm::Handle<FEDRawDataCollection> rawDataHandle;
108  e.getByLabel("source", rawDataHandle);
109 
110  if ( !rawDataHandle.isValid() ) {
111  rawdataAbsent = true;
112  return;
113  }
114 
115  rawdataAbsent = false;
116  const FEDRawDataCollection& rawDataCollection = *rawDataHandle;
117  for(std::vector<unsigned short>::const_iterator ifed = connectedFEDs.begin(); ifed != connectedFEDs.end(); ifed++){
118  const std::vector<FedChannelConnection> fedChannels = fedCabling_->connections( *ifed );
119  if (!(rawDataCollection.FEDData(*ifed).size()) || !(rawDataCollection.FEDData(*ifed).data()) ) continue;
120  // Check Modules Connected
121  for (std::vector<FedChannelConnection>::const_iterator iconn = fedChannels.begin();
122  iconn < fedChannels.end(); iconn++){
123  if (!iconn->isConnected()) continue;
124  uint32_t detId = iconn->detId();
125  StripSubdetector subdet(detId);
126  if ( (subdet.subdetId() == StripSubdetector::TIB) || (subdet.subdetId() == StripSubdetector::TID)) {
127  TIBTIDinDAQ = true;
128  break;
129  } else if (subdet.subdetId() == StripSubdetector::TOB) {
130  TOBinDAQ = true;
131  break;
132  } else if (subdet.subdetId() == StripSubdetector::TEC) {
133  if (TECDetId(detId).side() == 2) TECFinDAQ = true;
134  else if (TECDetId(detId).side() == 1) TECBinDAQ = true;
135  break;
136  }
137  }
138  if (TIBTIDinDAQ && TOBinDAQ && TECFinDAQ && TECBinDAQ) break;
139  }
140  initialised = true;
141  if (!TIBTIDinDAQ && !TOBinDAQ && !TECFinDAQ && !TECBinDAQ) trackerAbsent = true;
142 }
size_t size() const
Lenght of the data buffer in bytes.
Definition: FEDRawData.h:47
unsigned int side() const
positive or negative id
Definition: TECDetId.h:47
const FEDRawData & FEDData(int fedid) const
retrieve data for fed
bool isValid() const
Definition: HandleBase.h:76
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
Definition: FEDRawData.cc:29

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