CMS 3D CMS Logo

HcalEEUSMonitor Class Reference

Date
2009/02/11 18:37:11
Revision
1.1
More...

#include <DQM/HcalMonitorTasks/interface/HcalEEUSMonitor.h>

Inheritance diagram for HcalEEUSMonitor:

HcalBaseMonitor

List of all members.

Public Member Functions

void clearME ()
 HcalEEUSMonitor ()
void processEvent (const FEDRawDataCollection &rawraw, const HcalUnpackerReport &report, const HcalElectronicsMap &emap)
void processEvent_RawData (const FEDRawDataCollection &rawraw, const HcalUnpackerReport &report, const HcalElectronicsMap &emap)
void reset ()
void setup (const edm::ParameterSet &ps, DQMStore *dbe)
void unpack (const FEDRawData &raw, const HcalElectronicsMap &emap)
 ~HcalEEUSMonitor ()

Private Attributes

uint32_t consecutiveEETriggers [NUMFEDS][NUMSPIGS]
uint32_t consecutiveNETriggers [NUMFEDS][NUMSPIGS]
uint32_t consecutiveTriggers [NUMFEDS][NUMSPIGS]
int dccOrN
bool EEthisEvent [NUMSPIGS *NUMFEDS]
std::vector< intfedUnpackList_
int firstFED_
int ievt_
MonitorElementmeEECorrel_
MonitorElementmeEEFractSpigs_US0_EE1_
MonitorElementmeEEPerSpigot_
MonitorElementmeEEThisEvent_
MonitorElementmeEVT_
MonitorElementmeNormFractSpigs_US0_EE0_
MonitorElementmeNumberEETriggered_
MonitorElementmeNumberNETriggered_
MonitorElementmeNumberTriggered_
MonitorElementmeRawDataLength2_US0_EE0_
MonitorElementmeRawDataLength2_US0_EE1_
MonitorElementmeRawDataLength2_US1_EE0_
MonitorElementmeRawDataLength2_US1_EE1_
MonitorElementmeUSFractSpigs_US1_EE0_
MonitorElementmeUSFractSpigs_US1_EE1_
int numEEthisEvent
int prevOrN
int prevWasEE [NUMFEDS][NUMSPIGS]
uint64_t US0EE0count [NUMFEDS][NUMSPIGS]
uint64_t US0EE1count [NUMFEDS][NUMSPIGS]
uint64_t US1EE0count [NUMFEDS][NUMSPIGS]
uint64_t US1EE1count [NUMFEDS][NUMSPIGS]
uint64_t UScount [NUMFEDS][NUMSPIGS]


Detailed Description

Date
2009/02/11 18:37:11
Revision
1.1

Author:
J. Temple - Univ. of Maryland

Definition at line 37 of file HcalEEUSMonitor.h.


Constructor & Destructor Documentation

HcalEEUSMonitor::HcalEEUSMonitor (  ) 

Definition at line 19 of file HcalEEUSMonitor.cc.

References consecutiveEETriggers, consecutiveNETriggers, consecutiveTriggers, f, NUMFEDS, NUMSPIGS, prevWasEE, s, US0EE0count, US0EE1count, US1EE0count, US1EE1count, and UScount.

00020 {
00021       for (int f=0; f<NUMFEDS;f++){
00022         for (int s=0; s<NUMSPIGS; s++) {
00023           consecutiveEETriggers[f][s] = 0;
00024           consecutiveNETriggers[f][s] = 0;
00025           consecutiveTriggers[f][s]   = 0;
00026           prevWasEE[f][s]             = 0;}}
00027 
00028 //  cout << (int)sizeof(UScount) << endl;
00029   for (int f=0; f<NUMFEDS; f++) {
00030     for (int s=0; s<NUMSPIGS; s++) {
00031       UScount[f][s] = 0;
00032     }
00033   }
00034 
00035   //Francesco
00036 //  cout << (int)sizeof(US0EE0count) << endl;
00037   for (int f=0; f<NUMFEDS; f++) {
00038     for (int s=0; s<NUMSPIGS; s++) {
00039       US0EE0count[f][s] = 0;
00040     }
00041   }
00042 
00043 //  cout << (int)sizeof(US0EE1count) << endl;
00044   for (int f=0; f<NUMFEDS; f++) {
00045     for (int s=0; s<NUMSPIGS; s++) {
00046       US0EE1count[f][s] = 0;
00047     }
00048   }
00049 
00050 //  cout << (int)sizeof(US1EE0count) << endl;
00051   for (int f=0; f<NUMFEDS; f++) {
00052     for (int s=0; s<NUMSPIGS; s++) {
00053       US1EE0count[f][s] = 0;
00054     }
00055   }
00056 
00057 //  cout << (int)sizeof(US1EE1count) << endl;
00058   for (int f=0; f<NUMFEDS; f++) {
00059     for (int s=0; s<NUMSPIGS; s++) {
00060       US1EE1count[f][s] = 0;
00061     }
00062   }
00063   //----------
00064 
00065 }

HcalEEUSMonitor::~HcalEEUSMonitor (  ) 

Definition at line 68 of file HcalEEUSMonitor.cc.

00068 {}


Member Function Documentation

void HcalEEUSMonitor::clearME (  )  [virtual]

Reimplemented from HcalBaseMonitor.

Definition at line 72 of file HcalEEUSMonitor.cc.

References HcalBaseMonitor::baseFolder_, HcalBaseMonitor::m_dbe, meEVT_, DQMStore::removeContents(), and DQMStore::setCurrentFolder().

00073 {
00074   if (m_dbe) 
00075     {
00076       m_dbe->setCurrentFolder(baseFolder_);
00077       m_dbe->removeContents();
00078     } // if (m_dbe)
00079   meEVT_=0;
00080 } // void HcalEEUSMonitor::clearME()

void HcalEEUSMonitor::processEvent ( const FEDRawDataCollection rawraw,
const HcalUnpackerReport report,
const HcalElectronicsMap emap 
)

Definition at line 240 of file HcalEEUSMonitor.cc.

References GenMuonPlsPt100GeV_cfg::cout, dccOrN, EEthisEvent, lat::endl(), MonitorElement::Fill(), HcalBaseMonitor::fVerbosity, i, ievt_, HcalBaseMonitor::m_dbe, meEVT_, NUMFEDS, NUMSPIGS, prevOrN, and processEvent_RawData().

Referenced by HcalMonitorModule::analyze().

00245 {
00246   if (!m_dbe)
00247     {
00248       if (fVerbosity) cout <<"HcalEEUSMonitor::processEvent   DQMStore not instantiated!!!"<<endl;
00249       return;
00250     }
00251 
00252   // Fill Event Number
00253   ievt_++;
00254   meEVT_->Fill(ievt_);
00255 
00256 
00257   //EECorrels Assume the best, before unpack() 
00258   for (int i=0; i<(NUMSPIGS*NUMFEDS); i++) 
00259     EEthisEvent[i]=false;
00260 
00261   processEvent_RawData(rawraw, report, emap);
00262   prevOrN=dccOrN;
00263   return;
00264 } // void HcalEEUSMonitor::processEvent

void HcalEEUSMonitor::processEvent_RawData ( const FEDRawDataCollection rawraw,
const HcalUnpackerReport report,
const HcalElectronicsMap emap 
)

Definition at line 267 of file HcalEEUSMonitor.cc.

References GenMuonPlsPt100GeV_cfg::cout, dccOrN, EEthisEvent, lat::endl(), FEDRawDataCollection::FEDData(), fedUnpackList_, MonitorElement::Fill(), i, SurfaceOrientation::inner, HcalBaseMonitor::m_dbe, meEECorrel_, meEEThisEvent_, numEEthisEvent, NUMFEDS, NUMSPIGS, SurfaceOrientation::outer, prevOrN, FEDRawData::size(), and unpack().

Referenced by processEvent().

00270 {
00271   /*
00272     This processes Raw Data.
00273     Additional info on working with Raw Data can be found in 
00274     HcalDataFormatMonitor.cc
00275   */
00276   
00277 
00278   // Should not see this error
00279   if(!m_dbe) 
00280     {
00281       cout <<"HcalEEUSMonitor::processEvent_RawData:  DQMStore not instantiated!!!\n"<<endl;
00282       return;
00283     }
00284   numEEthisEvent = 0;
00285   // Loop over all FEDs reporting the event, unpacking if good.
00286   for (vector<int>::const_iterator i=fedUnpackList_.begin();i!=fedUnpackList_.end(); i++) 
00287     {
00288       const FEDRawData& fed = rawraw.FEDData(*i);
00289       if (fed.size()<12) continue; // Was 16.
00290       unpack(fed,emap);
00291     } // for (vector<int>::const_iterator i=fedUnpackList_.begin();...
00292 
00293   prevOrN=dccOrN;
00294   meEEThisEvent_->Fill(numEEthisEvent);
00295   numEEthisEvent = 0;
00296 
00297   //EECorrels :Fill a 2D histo where two each pair of 
00298   //spigots have EE in the same event.
00299   for (int outer=0; outer<(NUMSPIGS*NUMFEDS); outer++)
00300     if (EEthisEvent[outer]) 
00301       for (int inner=0; inner<(NUMSPIGS*NUMFEDS); inner++)
00302         if (EEthisEvent[inner]) 
00303           meEECorrel_->Fill(outer, inner);
00304   
00305   return;
00306 
00307 } // void HcalEEUSMonitor::processEvent_RawData(const FEDRawDataCollection& rawraw,

void HcalEEUSMonitor::reset ( void   ) 

Definition at line 70 of file HcalEEUSMonitor.cc.

Referenced by HcalMonitorModule::reset().

00070 {}

void HcalEEUSMonitor::setup ( const edm::ParameterSet ps,
DQMStore dbe 
) [virtual]

Reimplemented from HcalBaseMonitor.

Definition at line 83 of file HcalEEUSMonitor.cc.

References HcalBaseMonitor::baseFolder_, DQMStore::book1D(), DQMStore::book2D(), DQMStore::bookInt(), GenMuonPlsPt100GeV_cfg::cout, lat::endl(), f, fedUnpackList_, first, firstFED_, HcalBaseMonitor::fVerbosity, FEDNumbering::getHcalFEDIds(), i, ievt_, label, HcalBaseMonitor::m_dbe, meEECorrel_, meEEFractSpigs_US0_EE1_, meEEPerSpigot_, meEEThisEvent_, meEVT_, meNormFractSpigs_US0_EE0_, meNumberEETriggered_, meNumberNETriggered_, meNumberTriggered_, meRawDataLength2_US0_EE0_, meRawDataLength2_US0_EE1_, meRawDataLength2_US1_EE0_, meRawDataLength2_US1_EE1_, meUSFractSpigs_US1_EE0_, meUSFractSpigs_US1_EE1_, NUMFEDS, NUMSPIGS, prevOrN, HcalBaseMonitor::rootFolder_, s, MonitorElement::setBinLabel(), DQMStore::setCurrentFolder(), HcalBaseMonitor::setup(), HcalDCCHeader::SPIGOT_COUNT, and indexGen::title.

Referenced by HcalMonitorModule::HcalMonitorModule().

00084 {
00085   HcalBaseMonitor::setup(ps,dbe);  // perform setups of base class
00086 
00087   ievt_=0; // event counter
00088   baseFolder_ = rootFolder_ + "EEUSMonitor"; // Will create an "EEUSMonitor" subfolder in .root output
00089   if (fVerbosity) cout <<"<HcalEEUSMonitor::setup> Setup in progress"<<endl;
00090   
00091   
00092   if(fVerbosity) cout << "About to pushback fedUnpackList_" << endl;
00093   firstFED_ = FEDNumbering::getHcalFEDIds().first;
00094   if (fVerbosity>0) cout <<"FIRST FED = "<<firstFED_<<endl;
00095 
00096   for (int i=FEDNumbering::getHcalFEDIds().first; 
00097        i<=FEDNumbering::getHcalFEDIds().second; ++i) 
00098     {
00099       if(fVerbosity) cout << "<HcalEEUSMonitor::setup>:Pushback for fedUnpackList_: " << i <<endl;
00100       fedUnpackList_.push_back(i);
00101     } // for (int i=FEDNumbering::getHcalFEDIds().first;...
00102   
00103   
00104   
00105   if (m_dbe)
00106     {
00107       char* type;
00108       m_dbe->setCurrentFolder(baseFolder_);
00109       type = "EEUSMonitor Event Number";
00110       meEVT_ = m_dbe->bookInt(type); // store event number
00111 
00112       char label[10];
00113       //Francesco
00114   
00115       //fraction of X-Type events
00116   
00117       type = "Fraction Normal Events - US0 EE0";
00118       meNormFractSpigs_US0_EE0_ = m_dbe->book1D(type,type,481,0,481);
00119       for(int f=0; f<NUMFEDS; f++) {
00120         sprintf(label, "FED 7%02d", f);
00121         meNormFractSpigs_US0_EE0_->setBinLabel(1+(HcalDCCHeader::SPIGOT_COUNT*f), label);
00122         for(int s=1; s<HcalDCCHeader::SPIGOT_COUNT; s++) {
00123           sprintf(label, "sp%02d", s-1);
00124           meNormFractSpigs_US0_EE0_->setBinLabel(1+(HcalDCCHeader::SPIGOT_COUNT*f)+s, label);}}
00125   
00126       type = "Fraction Empty Events - US0 EE1";
00127       meEEFractSpigs_US0_EE1_ = m_dbe->book1D(type,type,481,0,481);
00128       for(int f=0; f<NUMFEDS; f++) {
00129         sprintf(label, "FED 7%02d", f);
00130         meEEFractSpigs_US0_EE1_->setBinLabel(1+(HcalDCCHeader::SPIGOT_COUNT*f), label);
00131         for(int s=1; s<HcalDCCHeader::SPIGOT_COUNT; s++) {
00132           sprintf(label, "sp%02d", s-1);
00133           meEEFractSpigs_US0_EE1_->setBinLabel(1+(HcalDCCHeader::SPIGOT_COUNT*f)+s, label);}}
00134 
00135       type = "Fraction UnSuppressed Events - US1 EE0";
00136       meUSFractSpigs_US1_EE0_ = m_dbe->book1D(type,type,481,0,481);
00137       for(int f=0; f<NUMFEDS; f++) {
00138         sprintf(label, "FED 7%02d", f);
00139         meUSFractSpigs_US1_EE0_->setBinLabel(1+(HcalDCCHeader::SPIGOT_COUNT*f), label);
00140         for(int s=1; s<HcalDCCHeader::SPIGOT_COUNT; s++) {
00141           sprintf(label, "sp%02d", s-1);
00142           meUSFractSpigs_US1_EE0_->setBinLabel(1+(HcalDCCHeader::SPIGOT_COUNT*f)+s, label);}}
00143 
00144       type = "Fraction UnSuppressed Events - US1 EE1";
00145       meUSFractSpigs_US1_EE1_ = m_dbe->book1D(type,type,481,0,481);
00146       for(int f=0; f<NUMFEDS; f++) {
00147         sprintf(label, "FED 7%02d", f);
00148         meUSFractSpigs_US1_EE1_->setBinLabel(1+(HcalDCCHeader::SPIGOT_COUNT*f), label);
00149         for(int s=1; s<HcalDCCHeader::SPIGOT_COUNT; s++) {
00150           sprintf(label, "sp%02d", s-1);
00151           meUSFractSpigs_US1_EE1_->setBinLabel(1+(HcalDCCHeader::SPIGOT_COUNT*f)+s, label);}}
00152 
00153       //raw data length for X-type events
00154 
00155       type = "Length of raw data - US0 EE0";
00156       meRawDataLength2_US0_EE0_ = m_dbe->book2D(type,type,481,0,481,600,0,1200);
00157       for(int f=0; f<NUMFEDS; f++) {
00158         sprintf(label, "FED 7%02d", f);
00159         meRawDataLength2_US0_EE0_->setBinLabel(1+(HcalDCCHeader::SPIGOT_COUNT*f), label);
00160         for(int s=1; s<HcalDCCHeader::SPIGOT_COUNT; s++) {
00161           sprintf(label, "sp%02d", s-1);
00162           meRawDataLength2_US0_EE0_->setBinLabel(1+(HcalDCCHeader::SPIGOT_COUNT*f)+s, label);}}
00163 
00164       type = "Length of raw data - US0 EE1";
00165       meRawDataLength2_US0_EE1_ = m_dbe->book2D(type,type,481,0,481,600,0,1200);
00166       for(int f=0; f<NUMFEDS; f++) {
00167         sprintf(label, "FED 7%02d", f);
00168         meRawDataLength2_US0_EE1_->setBinLabel(1+(HcalDCCHeader::SPIGOT_COUNT*f), label);
00169         for(int s=1; s<HcalDCCHeader::SPIGOT_COUNT; s++) {
00170           sprintf(label, "sp%02d", s-1);
00171           meRawDataLength2_US0_EE1_->setBinLabel(1+(HcalDCCHeader::SPIGOT_COUNT*f)+s, label);}}
00172 
00173       type = "Length of raw data - US1 EE0";
00174       meRawDataLength2_US1_EE0_ = m_dbe->book2D(type,type,481,0,481,600,0,1200);
00175       for(int f=0; f<NUMFEDS; f++) {
00176         sprintf(label, "FED 7%02d", f);
00177         meRawDataLength2_US1_EE0_->setBinLabel(1+(HcalDCCHeader::SPIGOT_COUNT*f), label);
00178         for(int s=1; s<HcalDCCHeader::SPIGOT_COUNT; s++) {
00179           sprintf(label, "sp%02d", s-1);
00180           meRawDataLength2_US1_EE0_->setBinLabel(1+(HcalDCCHeader::SPIGOT_COUNT*f)+s, label);}}
00181 
00182       type = "Length of raw data - US1 EE1";
00183       meRawDataLength2_US1_EE1_ = m_dbe->book2D(type,type,481,0,481,600,0,1200);
00184       for(int f=0; f<NUMFEDS; f++) {
00185         sprintf(label, "FED 7%02d", f);
00186         meRawDataLength2_US1_EE1_->setBinLabel(1+(HcalDCCHeader::SPIGOT_COUNT*f), label);
00187         for(int s=1; s<HcalDCCHeader::SPIGOT_COUNT; s++) {
00188           sprintf(label, "sp%02d", s-1);
00189           meRawDataLength2_US1_EE1_->setBinLabel(1+(HcalDCCHeader::SPIGOT_COUNT*f)+s, label);}}
00190 
00191       //---------
00192 
00193       //EECorrels Jason
00194   
00195       type="EE Spigot Correlation";
00196       meEECorrel_ = m_dbe->book2D(type, type,
00197                                   (NUMSPIGS * NUMFEDS), 0, (NUMSPIGS * NUMFEDS),
00198                                   (NUMSPIGS * NUMFEDS), 0, (NUMSPIGS * NUMFEDS));
00199       type="EE per Spigot";
00200       meEEPerSpigot_ = m_dbe->book1D(type, type,
00201                                   (NUMSPIGS * NUMFEDS), 0, (NUMSPIGS * NUMFEDS));
00202       type="EE Spigots per Event";
00203       meEEThisEvent_ = m_dbe->book1D(type, type,500,-0.5,499.5);
00204 
00205       //EE/NE Triggers Jared
00206   
00207       char title[128];
00208       sprintf(title, "EE Triggers");  // DCC FED number 700:731
00209       meNumberEETriggered_ = m_dbe->book2D(title,title,(NUMSPIGS * NUMFEDS),0,(NUMSPIGS * NUMFEDS),100,-0.5,99.5);
00210       sprintf(title, "NE Triggers");  // DCC FED number 700:731
00211       meNumberNETriggered_ = m_dbe->book2D(title,title,(NUMSPIGS * NUMFEDS),0,(NUMSPIGS * NUMFEDS),100,-0.5,99.5);
00212       sprintf(title, "Triggers");  // DCC FED number 700:731
00213       meNumberTriggered_ = m_dbe->book2D(title,title,(NUMSPIGS * NUMFEDS),0,(NUMSPIGS * NUMFEDS),100,-0.5,99.5);
00214       
00215       for (int f=0; f<NUMFEDS;f++){
00216         sprintf(label, "DCC 7%02d", f);  // DCC FED number 700:731
00217         meEECorrel_->setBinLabel(1+(f*NUMSPIGS), label, 1);
00218         meEECorrel_->setBinLabel(1+(f*NUMSPIGS), label, 2);
00219         meEEPerSpigot_->setBinLabel(1+(f*NUMSPIGS), label, 1);
00220         meNumberEETriggered_->setBinLabel(1+(f*NUMSPIGS), label, 1);
00221         meNumberNETriggered_->setBinLabel(1+(f*NUMSPIGS), label, 1);
00222         meNumberTriggered_->setBinLabel(1+(f*NUMSPIGS), label, 1);
00223         for (int s=1; s<NUMSPIGS; s+=2) {
00224           sprintf(label, "Spgt %02d", s-1);  // DCC Spigots
00225           meEECorrel_->setBinLabel((f*NUMSPIGS)+s+1, label, 1);
00226           meEECorrel_->setBinLabel((f*NUMSPIGS)+s+1, label, 2);
00227           meEEPerSpigot_->setBinLabel((f*NUMSPIGS)+s+1, label, 1);
00228           meNumberEETriggered_->setBinLabel((f*NUMSPIGS)+s+1, label, 1);
00229           meNumberNETriggered_->setBinLabel((f*NUMSPIGS)+s+1, label, 1);
00230           meNumberTriggered_->setBinLabel((f*NUMSPIGS)+s+1, label, 1);}}
00231       
00232       prevOrN = -1;
00233     } // if (m_dbe)
00234   
00235   return;
00236   
00237 } // void HcalEEUSMonitor::setup()

void HcalEEUSMonitor::unpack ( const FEDRawData raw,
const HcalElectronicsMap emap 
)

Definition at line 312 of file HcalEEUSMonitor.cc.

References consecutiveEETriggers, consecutiveNETriggers, consecutiveTriggers, GenMuonPlsPt100GeV_cfg::cout, FEDRawData::data(), dccOrN, EEthisEvent, lat::endl(), MonitorElement::Fill(), HcalHTRData::getExtHdr6(), HcalDCCHeader::getLRBErrorBits(), HcalDCCHeader::getOrbitNumber(), HcalHTRData::getRawData(), HcalHTRData::getRawLength(), HcalDCCHeader::getSourceId(), HcalDCCHeader::getSpigotData(), HcalDCCHeader::getSpigotErrorBits(), HcalDCCHeader::getSpigotPresent(), ievt_, HcalHTRData::isHistogramEvent(), j, max, meEEFractSpigs_US0_EE1_, meEEPerSpigot_, meNormFractSpigs_US0_EE0_, meNumberEETriggered_, meNumberNETriggered_, meNumberTriggered_, meRawDataLength2_US0_EE0_, meRawDataLength2_US0_EE1_, meRawDataLength2_US1_EE0_, meRawDataLength2_US1_EE1_, meUSFractSpigs_US1_EE0_, meUSFractSpigs_US1_EE1_, numEEthisEvent, NUMSPIGS, prevOrN, prevWasEE, MonitorElement::setBinContent(), FEDRawData::size(), HcalDCCHeader::SPIGOT_COUNT, HcalDCCHeader::thereIsASecondCDFHeaderWord(), US0EE0count, US0EE1count, US1EE0count, and US1EE1count.

Referenced by processEvent_RawData().

00314 {
00315   /* 
00316      This unpacks raw data info.  Additional info on working with the raw data can be found in the unpack method of HcalDataFormatMonitor.cc
00317   */
00318 
00319 
00320   // get the DCC header
00321   const HcalDCCHeader* dccHeader=(const HcalDCCHeader*)(raw.data());
00322   if(!dccHeader) return;
00323 
00324   // get the DCC trailer 
00325   unsigned char* trailer_ptr = (unsigned char*) (raw.data()+raw.size()-sizeof(uint64_t));
00326   FEDTrailer trailer = FEDTrailer(trailer_ptr);
00327 
00328   //DCC Event Fragment sizes distribution, in bytes.
00329   //  int rawsize = raw.size();
00330 
00331   int dccid  = dccHeader->getSourceId();
00332   //  int dccBCN = dccHeader->getBunchId();
00333   dccOrN = dccHeader->getOrbitNumber();
00334   //  unsigned long dccEvtNum = dccHeader->getDCCEventNumber();
00335 
00336   uint64_t* lastDataWord = (uint64_t*) ( raw.data()+raw.size()-(2*sizeof(uint64_t)) );
00337   int EvFragLength = ((*lastDataWord>>32)*8);
00338   EvFragLength = raw.size();
00339 
00340 
00341   unsigned char WholeErrorList=0; 
00342   for(int j=0; j<HcalDCCHeader::SPIGOT_COUNT; j++) {
00343     WholeErrorList=dccHeader->getSpigotErrorBits((unsigned int) j);
00344     //EECorrels :Record EE for cross-correlation plotting.
00345     if ((WholeErrorList>>2)&0x01) EEthisEvent[(NUMSPIGS *max(0,dccid-700))+j] = true;
00346   }
00347 
00348   //
00349 
00350   // walk through the HTR data...
00351   HcalHTRData htr;  
00352   for (int spigot=0; spigot<HcalDCCHeader::SPIGOT_COUNT; spigot++) {
00353     if (!dccHeader->getSpigotPresent(spigot)) continue;
00354     
00355     bool chsummAOK=true;
00356 //    bool channAOK=true;
00357 
00358     // From this Spigot's DCC header, first.
00359     WholeErrorList=dccHeader->getLRBErrorBits((unsigned int) spigot);
00360     // Load the given decoder with the pointer and length from this spigot.
00361     dccHeader->getSpigotData(spigot,htr, raw.size()); 
00362     const unsigned short* HTRraw = htr.getRawData();
00363     unsigned short HTRwdcount = HTRraw[htr.getRawLength() - 2];
00364     
00365     
00366     //fix me!
00367     HTRwdcount=htr.getRawLength();
00368 
00369     // Size checks for internal consistency
00370     // getNTP(), get NDD() seems to be mismatched with format. Manually:
00371     int NTP = ((htr.getExtHdr6() >> 8) & 0x00FF);
00372     int NDAQ = (HTRraw[htr.getRawLength() - 4] & 0x7FF);
00373     
00374     int here=1+(HcalDCCHeader::SPIGOT_COUNT*(dccid-700))+spigot;
00375 
00376     if ( !  ((HTRwdcount != 8)               ||
00377              (HTRwdcount != 12 + NTP + NDAQ) ||
00378              (HTRwdcount != 20 + NTP + NDAQ)    )) {
00379       chsummAOK=false;
00380       //incompatible Sizes declared. Skip it.
00381       continue; }
00382     bool EE = ((dccHeader->getSpigotErrorBits(spigot) >> 2) & 0x01);
00383     if (EE) { 
00384       numEEthisEvent++;
00385       meEEPerSpigot_->Fill(here);
00386       if (HTRwdcount != 8) {
00387         chsummAOK=false;
00388         //incompatible Sizes declared. Skip it.
00389         continue;}}
00390     else{ //For non-EE,
00391       if ((HTRwdcount-NDAQ-NTP) != 20) {
00392         chsummAOK=false;
00393         //incompatible Sizes declared. Skip it.
00394         continue;}}
00395 
00396     //Jared
00397     if(dccOrN==prevOrN){
00398       consecutiveTriggers[dccid-700][spigot]++;
00399       if(prevWasEE[dccid-700][spigot]) {
00400         if (EE) consecutiveEETriggers[dccid-700][spigot]++;
00401         else {
00402           meNumberEETriggered_->Fill(here,consecutiveEETriggers[dccid-700][spigot]);
00403           consecutiveEETriggers[dccid-700][spigot]   = 0;
00404           consecutiveNETriggers[dccid-700][spigot]++;}}
00405       else {
00406         if(!EE) consecutiveNETriggers[dccid-700][spigot]++;
00407         else {
00408           meNumberNETriggered_->Fill(here,consecutiveNETriggers[dccid-700][spigot]);
00409           consecutiveNETriggers[dccid-700][spigot] = 0;
00410           consecutiveEETriggers[dccid-700][spigot]++;}}}
00411     else {
00412       if (prevOrN>-1) {
00413         meNumberTriggered_->Fill(here,consecutiveTriggers[dccid-700][spigot]);
00414         meNumberEETriggered_->Fill(here,consecutiveEETriggers[dccid-700][spigot]);
00415         meNumberNETriggered_->Fill(here,consecutiveNETriggers[dccid-700][spigot]);}
00416       consecutiveTriggers[dccid-700][spigot]   = 1;
00417       if(EE) {
00418         consecutiveEETriggers[dccid-700][spigot] = 1;
00419         consecutiveNETriggers[dccid-700][spigot] = 0;}
00420       else {
00421         consecutiveEETriggers[dccid-700][spigot] = 0;
00422         consecutiveNETriggers[dccid-700][spigot] = 1;}}
00423 //    printf("%5d, %7.2d, %d, %8d, %22d, %22d, %20d, %3d, %10d\n",dccid,spigot,dccOrN,prevOrN,\
00424 //         consecutiveEETriggers[dccid-700][spigot],consecutiveNETriggers[dccid-700][spigot],\
00425 //         consecutiveTriggers[dccid-700][spigot],EE,prevWasEE[dccid-700][spigot]);
00426     if (EE) prevWasEE[dccid-700][spigot] = 1;
00427     else    prevWasEE[dccid-700][spigot] = 0;
00428 
00429     if (htr.isHistogramEvent()) continue;
00430 
00431     bool htrUnSuppressed=(HTRraw[6]>>15 & 0x0001);
00432     //Francesco
00433     bool htrEmpty=(HTRraw[2] & 0x4);
00434 
00435 //    if (htrUnSuppressed) {
00436 //      UScount[dccid-700][spigot]++;
00437 //      int here=1+(HcalDCCHeader::SPIGOT_COUNT*(dccid-700))+spigot;
00438 //      meUSFractSpigs_->setBinContent(here,((double)UScount[dccid-700][spigot])/(double)ievt_);}
00439   
00440   //Francesco
00441   
00442     //cout << "HTRwdcount: " << HTRwdcount << endl;
00443 
00444     if (htrUnSuppressed==false && htrEmpty==false){
00445       US0EE0count[dccid-700][spigot]++;
00446       meNormFractSpigs_US0_EE0_->setBinContent(here,
00447                                                ((double)US0EE0count[dccid-700][spigot])/(double)ievt_);
00448       meRawDataLength2_US0_EE0_->Fill(here-1, HTRwdcount);
00449     }
00450     
00451     if (htrUnSuppressed==false && htrEmpty==true){
00452       US0EE1count[dccid-700][spigot]++;
00453       meEEFractSpigs_US0_EE1_->setBinContent(here,
00454                                              ((double)US0EE1count[dccid-700][spigot])/(double)ievt_);
00455       meRawDataLength2_US0_EE1_->Fill(here-1, HTRwdcount);
00456     }
00457         
00458     if (htrUnSuppressed==true && htrEmpty==false){
00459       US1EE0count[dccid-700][spigot]++;
00460       meUSFractSpigs_US1_EE0_->setBinContent(here,
00461                                              ((double)US1EE0count[dccid-700][spigot])/(double)ievt_);
00462       meRawDataLength2_US1_EE0_->Fill(here-1, HTRwdcount);
00463     }
00464     
00465     if (htrUnSuppressed==true && htrEmpty==true){
00466       US1EE1count[dccid-700][spigot]++;
00467       meUSFractSpigs_US1_EE1_->setBinContent(here,
00468                                              ((double)US1EE1count[dccid-700][spigot])/(double)ievt_);
00469       meRawDataLength2_US1_EE1_->Fill(here-1, HTRwdcount);
00470     }
00471     //--------
00472     
00473 
00474   }//end of HTRdata
00475 
00476     // Dump out some raw data info
00477 //  cout <<"RAWSIZE = "<<rawsize<<endl;
00478 //  cout <<"dcc id = "<<dccid<<endl;
00479 //  cout <<"dccBCN = "<<dccBCN<<endl;
00480 //  cout <<"dccEvtNum = "<<dccEvtNum<<endl;
00481 //  cout <<"EvFragLength = "<<EvFragLength<<endl;
00482   /* 1 */ //There should always be a second CDF header word indicated.
00483   if (!dccHeader->thereIsASecondCDFHeaderWord()) 
00484     {
00485     cout <<"No second CDF header found!"<<endl;
00486     }
00487 
00488   return;
00489 } // void HcalEEUSMonitor::unpack(...)


Member Data Documentation

uint32_t HcalEEUSMonitor::consecutiveEETriggers[NUMFEDS][NUMSPIGS] [private]

Definition at line 107 of file HcalEEUSMonitor.h.

Referenced by HcalEEUSMonitor(), and unpack().

uint32_t HcalEEUSMonitor::consecutiveNETriggers[NUMFEDS][NUMSPIGS] [private]

Definition at line 108 of file HcalEEUSMonitor.h.

Referenced by HcalEEUSMonitor(), and unpack().

uint32_t HcalEEUSMonitor::consecutiveTriggers[NUMFEDS][NUMSPIGS] [private]

Definition at line 109 of file HcalEEUSMonitor.h.

Referenced by HcalEEUSMonitor(), and unpack().

int HcalEEUSMonitor::dccOrN [private]

Definition at line 110 of file HcalEEUSMonitor.h.

Referenced by processEvent(), processEvent_RawData(), and unpack().

bool HcalEEUSMonitor::EEthisEvent[NUMSPIGS *NUMFEDS] [private]

Definition at line 75 of file HcalEEUSMonitor.h.

Referenced by processEvent(), processEvent_RawData(), and unpack().

std::vector<int> HcalEEUSMonitor::fedUnpackList_ [private]

Definition at line 63 of file HcalEEUSMonitor.h.

Referenced by processEvent_RawData(), and setup().

int HcalEEUSMonitor::firstFED_ [private]

Definition at line 64 of file HcalEEUSMonitor.h.

Referenced by setup().

int HcalEEUSMonitor::ievt_ [private]

Definition at line 60 of file HcalEEUSMonitor.h.

Referenced by processEvent(), setup(), and unpack().

MonitorElement* HcalEEUSMonitor::meEECorrel_ [private]

Definition at line 69 of file HcalEEUSMonitor.h.

Referenced by processEvent_RawData(), and setup().

MonitorElement* HcalEEUSMonitor::meEEFractSpigs_US0_EE1_ [private]

Definition at line 80 of file HcalEEUSMonitor.h.

Referenced by setup(), and unpack().

MonitorElement* HcalEEUSMonitor::meEEPerSpigot_ [private]

Definition at line 70 of file HcalEEUSMonitor.h.

Referenced by setup(), and unpack().

MonitorElement* HcalEEUSMonitor::meEEThisEvent_ [private]

Definition at line 71 of file HcalEEUSMonitor.h.

Referenced by processEvent_RawData(), and setup().

MonitorElement* HcalEEUSMonitor::meEVT_ [private]

Definition at line 61 of file HcalEEUSMonitor.h.

Referenced by clearME(), processEvent(), and setup().

MonitorElement* HcalEEUSMonitor::meNormFractSpigs_US0_EE0_ [private]

Definition at line 79 of file HcalEEUSMonitor.h.

Referenced by setup(), and unpack().

MonitorElement* HcalEEUSMonitor::meNumberEETriggered_ [private]

Definition at line 102 of file HcalEEUSMonitor.h.

Referenced by setup(), and unpack().

MonitorElement* HcalEEUSMonitor::meNumberNETriggered_ [private]

Definition at line 103 of file HcalEEUSMonitor.h.

Referenced by setup(), and unpack().

MonitorElement* HcalEEUSMonitor::meNumberTriggered_ [private]

Definition at line 104 of file HcalEEUSMonitor.h.

Referenced by setup(), and unpack().

MonitorElement* HcalEEUSMonitor::meRawDataLength2_US0_EE0_ [private]

Definition at line 84 of file HcalEEUSMonitor.h.

Referenced by setup(), and unpack().

MonitorElement* HcalEEUSMonitor::meRawDataLength2_US0_EE1_ [private]

Definition at line 85 of file HcalEEUSMonitor.h.

Referenced by setup(), and unpack().

MonitorElement* HcalEEUSMonitor::meRawDataLength2_US1_EE0_ [private]

Definition at line 86 of file HcalEEUSMonitor.h.

Referenced by setup(), and unpack().

MonitorElement* HcalEEUSMonitor::meRawDataLength2_US1_EE1_ [private]

Definition at line 87 of file HcalEEUSMonitor.h.

Referenced by setup(), and unpack().

MonitorElement* HcalEEUSMonitor::meUSFractSpigs_US1_EE0_ [private]

Definition at line 81 of file HcalEEUSMonitor.h.

Referenced by setup(), and unpack().

MonitorElement* HcalEEUSMonitor::meUSFractSpigs_US1_EE1_ [private]

Definition at line 82 of file HcalEEUSMonitor.h.

Referenced by setup(), and unpack().

int HcalEEUSMonitor::numEEthisEvent [private]

Definition at line 76 of file HcalEEUSMonitor.h.

Referenced by processEvent_RawData(), and unpack().

int HcalEEUSMonitor::prevOrN [private]

Definition at line 111 of file HcalEEUSMonitor.h.

Referenced by processEvent(), processEvent_RawData(), setup(), and unpack().

int HcalEEUSMonitor::prevWasEE[NUMFEDS][NUMSPIGS] [private]

Definition at line 112 of file HcalEEUSMonitor.h.

Referenced by HcalEEUSMonitor(), and unpack().

uint64_t HcalEEUSMonitor::US0EE0count[NUMFEDS][NUMSPIGS] [private]

Definition at line 92 of file HcalEEUSMonitor.h.

Referenced by HcalEEUSMonitor(), and unpack().

uint64_t HcalEEUSMonitor::US0EE1count[NUMFEDS][NUMSPIGS] [private]

Definition at line 93 of file HcalEEUSMonitor.h.

Referenced by HcalEEUSMonitor(), and unpack().

uint64_t HcalEEUSMonitor::US1EE0count[NUMFEDS][NUMSPIGS] [private]

Definition at line 94 of file HcalEEUSMonitor.h.

Referenced by HcalEEUSMonitor(), and unpack().

uint64_t HcalEEUSMonitor::US1EE1count[NUMFEDS][NUMSPIGS] [private]

Definition at line 95 of file HcalEEUSMonitor.h.

Referenced by HcalEEUSMonitor(), and unpack().

uint64_t HcalEEUSMonitor::UScount[NUMFEDS][NUMSPIGS] [private]

Definition at line 91 of file HcalEEUSMonitor.h.

Referenced by HcalEEUSMonitor().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:23:39 2009 for CMSSW by  doxygen 1.5.4