CMS 3D CMS Logo

DCCEBSRPBlock.cc
Go to the documentation of this file.
6 
7 
8 
11 ) : DCCSRPBlock(u,m,e,unpack)
12 {
13 
15 
16 }
17 
18 
20  // Set SR flag digis
22 }
23 
24 
26 
27  // Point to SR flags
28  data_++;
29  const uint16_t * my16Bitp_ = reinterpret_cast<const uint16_t *> (data_);
30 
31  unsigned int towersInPhi = EcalElectronicsMapper::kTowersInPhi;
32 
33  unsigned int fov = event_->fov();
34 
35 
36  for( unsigned int n=0; n<expNumbSrFlags_ ; n++ ){
37 
38  if(n>0&&n%4==0) my16Bitp_++;
39 
40  unsigned short srFlag = ( *my16Bitp_ >> ( (n-(n/4)*4) * 3 ) ) & SRP_SRFLAG_MASK ;
41 
42  unsigned int theSRPi = n ;
43 
44 
45  if(NUMB_SM_EB_PLU_MIN<= mapper_->getActiveSM() && mapper_->getActiveSM()<=NUMB_SM_EB_PLU_MAX && fov>=1 ){
46  unsigned int u = n%towersInPhi;
47  u = towersInPhi-u;
48  theSRPi = ( n/towersInPhi )*towersInPhi + u - 1;
49  }
50 
51 
52  srFlags_[theSRPi] = srFlag;
53 
55 
56  std::vector<EcalSrFlag*> srs = mapper_->getSrFlagPointer(theSRPi+1);
57 
58  for(size_t i = 0; i < srs.size(); ++i){
59  srs[i]->setValue(srFlag);
60  (*ebSrFlagsDigis_)->push_back(*((EBSrFlag*)srs[i]));
61  }
62  }
63  }
64 }
65 
66 
67 
69 
70  //todo : check srp id based on sm...
71 
72  // Check number of SR flags
73  if (nSRFlags_ != expNumbSrFlags_) {
75  edm::LogWarning("IncorrectBlock")
76  <<"Unable to unpack SRP block for event " << event_->l1A()<<" in fed <<"<<mapper_->getActiveDCC()
77  <<"\nNumber of flags "<<nSRFlags_<<" is different from expected "<<expNumbSrFlags_;
78  }
79  //Note : add to error collection ?
80  return false;
81  }
82  return true;
83 
84 }
85 
std::unique_ptr< EBSrFlagCollection > * ebSrFlagsCollection()
int i
Definition: DBlmapReader.cc:9
std::unique_ptr< EBSrFlagCollection > * ebSrFlagsDigis_
Definition: DCCEBSRPBlock.h:48
unsigned short srFlags_[SRP_NUMBFLAGS]
Definition: DCCSRPBlock.h:57
std::vector< EcalSrFlag * > getSrFlagPointer(unsigned int feChannel)
unsigned int expNumbSrFlags_
Definition: DCCSRPBlock.h:55
void updateCollectors()
static std::atomic< bool > silentMode_
unsigned short srFlag(unsigned int feChannel)
Definition: DCCSRPBlock.h:43
DCCEBSRPBlock(DCCDataUnpacker *u, EcalElectronicsMapper *m, DCCEventBlock *e, bool unpack)
Definition: DCCEBSRPBlock.cc:9
unsigned int fov()
Definition: DCCEventBlock.h:52
DCCDataUnpacker * unpacker_
void addSRFlagToCollection()
EcalElectronicsMapper * mapper_
unsigned int nSRFlags_
Definition: DCCSRPBlock.h:54
bool checkSrpIdAndNumbSRFlags()
unsigned int l1A()
Definition: DCCEventBlock.h:54