CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
DCCEBTCCBlock.cc
Go to the documentation of this file.
5 
7 : DCCTCCBlock(u,m,e,unpack)
8 {
11 }
12 
15 }
16 
18 
20 
21  if( tccId_ != expTccId_ ){
22 
24  edm::LogWarning("IncorrectBlock")
25  <<"Error on event "<<event_->l1A()<<" with bx "<<event_->bx()<<" in fed "<<mapper_->getActiveDCC()
26  <<"\n TCC id is "<<tccId_<<" while expected is "<<expTccId_
27  <<"\n TCC Block Skipped ...";
28  //todo : add this to error colection
29  }
30  return false;
31  }
32 
33  //Check number of TT Flags
34  if( nTTs_ != expNumbTTs_ ){
36  edm::LogWarning("IncorrectBlock")
37  <<"Unable to unpack TCC block for event "<<event_->l1A()<<" in fed "<<mapper_->getActiveDCC()
38  <<"\n Number of TTs "<<nTTs_<<" is different from expected "<<expNumbTTs_
39  <<"\n TCC Block Skipped ...";
40  //todo : add this to error colection
41  }
42  return false;
43  }
44  return true;
45 }
46 
47 
49 
50  //point to trigger data
51  data_++;
52 
53  unsigned int towersInPhi = EcalElectronicsMapper::kTowersInPhi;
54 
55  const uint16_t * tccP_= reinterpret_cast<const uint16_t * >(data_);
56 
57 
58  for( unsigned int i = 1; i <= expNumbTTs_; i++){
59 
60  unsigned int theTT = i;
61 
62  if(NUMB_SM_EB_PLU_MIN<= mapper_->getActiveSM() && mapper_->getActiveSM()<=NUMB_SM_EB_PLU_MAX)
63  {
64  unsigned int u = (i-1)%towersInPhi;
65  u = towersInPhi-u;
66  theTT = ( (i-1)/towersInPhi )*towersInPhi + u;
67  }
68 
69  pTP_ = mapper_->getTPPointer(tccId_,theTT);
70  for(unsigned int ns = 0; ns<nTSamples_;ns++,tccP_++){
71 
72  pTP_->setSampleValue(ns, (*tccP_));
73  (*tps_)->push_back(*pTP_);
74 
75  }
76  }
77 
78 
79 }
80 
81 
int i
Definition: DBlmapReader.cc:9
unsigned int getEBTCCBlockLength()
unsigned int nTSamples_
Definition: DCCTCCBlock.h:62
std::auto_ptr< EcalTrigPrimDigiCollection > * tps_
Definition: DCCTCCBlock.h:70
static bool silentMode_
DCCEBTCCBlock(DCCDataUnpacker *u, EcalElectronicsMapper *m, DCCEventBlock *e, bool unpack)
Definition: DCCEBTCCBlock.cc:6
unsigned int bx()
Definition: DCCEventBlock.h:57
EcalTriggerPrimitiveDigi * pTP_
Definition: DCCTCCBlock.h:68
void addTriggerPrimitivesToCollection()
void updateCollectors()
void setSampleValue(int i, uint16_t value)
unsigned int tccId_
Definition: DCCTCCBlock.h:56
DCCDataUnpacker * unpacker_
unsigned int expNumbTTs_
Definition: DCCTCCBlock.h:63
std::auto_ptr< EcalTrigPrimDigiCollection > * ecalTpsCollection()
unsigned int nTTs_
Definition: DCCTCCBlock.h:61
bool checkTccIdAndNumbTTs()
EcalTriggerPrimitiveDigi * getTPPointer(unsigned int tccId, unsigned int tower)
EcalElectronicsMapper * mapper_
unsigned int expTccId_
Definition: DCCTCCBlock.h:64
unsigned int l1A()
Definition: DCCEventBlock.h:56