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 Attributes
EcalFenixTcpFormat Class Reference

#include <EcalFenixTcpFormat.h>

Public Member Functions

 EcalFenixTcpFormat (bool tccFormat, bool debug, bool famos, int binOfMax)
 
virtual std::vector< int > process (const std::vector< int > &, const std::vector< int > &)
 
void process (std::vector< int > &Et, std::vector< int > &fgvb, std::vector< int > &sfgvb, int eTTotShift, std::vector< EcalTriggerPrimitiveSample > &out, std::vector< EcalTriggerPrimitiveSample > &outTcc, bool isInInnerRings)
 
void setParameters (uint32_t towid, const EcalTPGLutGroup *ecaltpgLutGroup, const EcalTPGLutIdMap *ecaltpgLut, const EcalTPGTowerStatus *ecaltpgbadTT, const EcalTPGSpike *ecaltpgSpike)
 
virtual ~EcalFenixTcpFormat ()
 

Private Attributes

const uint16_t * badTTStatus_
 
unsigned int binOfMax_
 
bool debug_
 
bool famos_
 
const unsigned int * lut_
 
uint16_t spikeZeroThresh_
 
uint16_t status_
 
bool tcpFormat_
 

Detailed Description

Definition at line 22 of file EcalFenixTcpFormat.h.

Constructor & Destructor Documentation

EcalFenixTcpFormat::EcalFenixTcpFormat ( bool  tccFormat,
bool  debug,
bool  famos,
int  binOfMax 
)

Definition at line 11 of file EcalFenixTcpFormat.cc.

References badTTStatus_, and status_.

12  : tcpFormat_(tcpFormat),debug_(debug),famos_(famos),binOfMax_(binOfMax)
13 {
14  status_=0;
16 }
const uint16_t * badTTStatus_
#define debug
Definition: HDRShower.cc:19
EcalFenixTcpFormat::~EcalFenixTcpFormat ( )
virtual

Definition at line 18 of file EcalFenixTcpFormat.cc.

18  {
19 }

Member Function Documentation

virtual std::vector<int> EcalFenixTcpFormat::process ( const std::vector< int > &  ,
const std::vector< int > &   
)
inlinevirtual
void EcalFenixTcpFormat::process ( std::vector< int > &  Et,
std::vector< int > &  fgvb,
std::vector< int > &  sfgvb,
int  eTTotShift,
std::vector< EcalTriggerPrimitiveSample > &  out,
std::vector< EcalTriggerPrimitiveSample > &  outTcc,
bool  isInInnerRings 
)

Definition at line 22 of file EcalFenixTcpFormat.cc.

References badTTStatus_, binOfMax_, famos_, i, lut_, spikeZeroThresh_, and tcpFormat_.

Referenced by ConfigBuilder.ConfigBuilder::__init__(), ConfigBuilder.ConfigBuilder::addExtraStream(), ConfigBuilder.ConfigBuilder::anyOf(), ConfigBuilder.ConfigBuilder::completeInputCommand(), ConfigBuilder.ConfigBuilder::doNotInlineEventContent(), ConfigBuilder.ConfigBuilder.PrintAllModules::leave(), ConfigBuilder.ConfigBuilder::prepare(), ConfigBuilder.ConfigBuilder::prepare_ALCA(), ConfigBuilder.ConfigBuilder::prepare_DQM(), ConfigBuilder.ConfigBuilder::prepare_FASTSIM(), ConfigBuilder.ConfigBuilder::prepare_HARVESTING(), ConfigBuilder.ConfigBuilder::prepare_HLT(), ConfigBuilder.ConfigBuilder::prepare_LHE(), ConfigBuilder.ConfigBuilder::prepare_VALIDATION(), ConfigBuilder.ConfigBuilder::renameHLTprocessInSequence(), ConfigBuilder.ConfigBuilder::renameInputTagsInSequence(), and ConfigBuilder.ConfigBuilder::scheduleSequence().

25  {
26  // put TP-s in the output
27  // on request also in TcpFormat
28  // for famos version we have to write dummies except for the middle
29 
30  int myEt;
31  if (famos_) {
32  for (unsigned int i=0; i<out.size();++i) {
33  if (i==binOfMax_-1) {
34  myEt=Et[0]>>eTTotShift;
35  if (myEt>0x3ff) myEt=0x3ff ;
36  if (isInInnerRings) myEt = myEt /2 ;
37 
38  // badTTStatus_ ==0 if the TT works
39  // badTTStatus_ !=0 if there are some problems
40  int lut_out;
41  if (*badTTStatus_!=0){
42  lut_out = 0;
43  }
44  else
45  lut_out = (lut_)[myEt] ;
46 
47  int ttFlag = (lut_out & 0x700) >> 8 ;
48  myEt = lut_out & 0xff ;
49  out[i]=EcalTriggerPrimitiveSample( myEt,fgvb[0],sfgvb[0],ttFlag);
50  }
52  }
53  }
54  else {
55  for (unsigned int i=0; i<Et.size();++i) {
56  int myFgvb=fgvb[i];
57  int mysFgvb=sfgvb[i];
58  //myEt=Et[i]>>eTTotShift;
59  //if (myEt>0x3ff) myEt=0x3ff ;
60  //if (isInInnerRings) myEt = myEt /2 ;
61 
62  // bug fix 091009:
63  myEt=Et[i];
64  if (myEt>0xfff)
65  myEt=0xfff ;
66  if (isInInnerRings)
67  myEt = myEt /2 ;
68  myEt >>= eTTotShift ;
69  if (myEt>0x3ff) myEt=0x3ff ;
70 
71  // Spike killing
72  if((myEt > spikeZeroThresh_) && (mysFgvb == 0))
73  {
74  myEt = 0;
75  }
76 
77  int lut_out;
78  if (*badTTStatus_!=0){
79  lut_out = 0;
80  }
81  else
82  lut_out = (lut_)[myEt] ;
83 
84  int ttFlag = (lut_out & 0x700) >> 8 ;
85  if (tcpFormat_) {
86  out2[i]=EcalTriggerPrimitiveSample( ((ttFlag&0x7)<<11) | ((myFgvb & 0x1)<<10) | (myEt & 0x3ff));
87  }
88  myEt = lut_out & 0xff ;
89  out[i]=EcalTriggerPrimitiveSample( myEt,myFgvb,mysFgvb,ttFlag);
90  }
91  }
92 }
int i
Definition: DBlmapReader.cc:9
const uint16_t * badTTStatus_
const unsigned int * lut_
tuple out
Definition: dbtoconf.py:99
void EcalFenixTcpFormat::setParameters ( uint32_t  towid,
const EcalTPGLutGroup ecaltpgLutGroup,
const EcalTPGLutIdMap ecaltpgLut,
const EcalTPGTowerStatus ecaltpgbadTT,
const EcalTPGSpike ecaltpgSpike 
)

Definition at line 94 of file EcalFenixTcpFormat.cc.

References badTTStatus_, EcalTPGSpike::getMap(), lut_, and spikeZeroThresh_.

Referenced by EcalFenixTcp::process_part2_barrel(), and EcalFenixTcp::process_part2_endcap().

95 {
96  // Get TP zeroing threshold - defaut to 1023 for old data (no record found or EE)
97  spikeZeroThresh_ = 1023;
98  if(ecaltpgSpike != 0)
99  {
100  const EcalTPGSpike::EcalTPGSpikeMap &spikeMap = ecaltpgSpike->getMap();
101  EcalTPGSpike:: EcalTPGSpikeMapIterator sit = spikeMap.find(towid);
102  if(sit != spikeMap.end())
103  {
104  spikeZeroThresh_ = sit->second;
105  }
106  }
107 
108  const EcalTPGGroups::EcalTPGGroupsMap & groupmap = ecaltpgLutGroup -> getMap();
109  EcalTPGGroups::EcalTPGGroupsMapItr it=groupmap.find(towid);
110  if (it!=groupmap.end()) {
111  uint32_t lutid=(*it).second;
112  const EcalTPGLutIdMap::EcalTPGLutMap &lutmap = ecaltpgLut-> getMap();
113  EcalTPGLutIdMap::EcalTPGLutMapItr itl=lutmap.find(lutid);
114  if (itl!=lutmap.end()) {
115  lut_=(*itl).second.getLut();
116  } else edm::LogWarning("EcalTPG")<<" could not find EcalTPGLutMap for "<<lutid;
117 
118  }
119  else edm::LogWarning("EcalTPG")<<" could not find EcalTPGFineGrainTowerEEMap for "<<towid;
120 
121  const EcalTPGTowerStatusMap & badTTMap = ecaltpgbadTT -> getMap();
122  EcalTPGTowerStatusMapIterator itbadTT = badTTMap.find(towid);
123  if (itbadTT!=badTTMap.end()) {
124  badTTStatus_=&(*itbadTT).second;
125  }
126 }
std::map< uint32_t, uint16_t >::const_iterator EcalTPGTowerStatusMapIterator
std::map< uint32_t, uint16_t > EcalTPGTowerStatusMap
std::map< uint32_t, uint32_t >::const_iterator EcalTPGGroupsMapItr
Definition: EcalTPGGroups.h:23
const uint16_t * badTTStatus_
std::map< uint32_t, uint16_t >::const_iterator EcalTPGSpikeMapIterator
Definition: EcalTPGSpike.h:13
const unsigned int * lut_
std::map< uint32_t, EcalTPGLut > EcalTPGLutMap
std::map< uint32_t, uint16_t > EcalTPGSpikeMap
Definition: EcalTPGSpike.h:12
std::map< uint32_t, uint32_t > EcalTPGGroupsMap
Definition: EcalTPGGroups.h:22
std::map< uint32_t, EcalTPGLut >::const_iterator EcalTPGLutMapItr
const std::map< uint32_t, uint16_t > & getMap() const
Definition: EcalTPGSpike.h:19

Member Data Documentation

const uint16_t* EcalFenixTcpFormat::badTTStatus_
private

Definition at line 33 of file EcalFenixTcpFormat.h.

Referenced by EcalFenixTcpFormat(), process(), and setParameters().

unsigned int EcalFenixTcpFormat::binOfMax_
private

Definition at line 38 of file EcalFenixTcpFormat.h.

Referenced by process().

bool EcalFenixTcpFormat::debug_
private

Definition at line 36 of file EcalFenixTcpFormat.h.

bool EcalFenixTcpFormat::famos_
private

Definition at line 37 of file EcalFenixTcpFormat.h.

Referenced by process().

const unsigned int* EcalFenixTcpFormat::lut_
private

Definition at line 32 of file EcalFenixTcpFormat.h.

Referenced by process(), and setParameters().

uint16_t EcalFenixTcpFormat::spikeZeroThresh_
private

Definition at line 39 of file EcalFenixTcpFormat.h.

Referenced by process(), and setParameters().

uint16_t EcalFenixTcpFormat::status_
private

Definition at line 34 of file EcalFenixTcpFormat.h.

Referenced by EcalFenixTcpFormat().

bool EcalFenixTcpFormat::tcpFormat_
private

Definition at line 35 of file EcalFenixTcpFormat.h.

Referenced by process().