CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
RCTEmRegionPacker.cc
Go to the documentation of this file.
3 
5 
12 
13 #include "PhysicsToBitConverter.h"
14 #include "rctDataBase.h"
15 
16 
17 #include "CaloTokens.h"
18 
19 namespace l1t {
20  namespace stage1 {
21  class RCTEmRegionPacker : public Packer {
22  public:
23  virtual Blocks pack(const edm::Event&, const PackerTokens*) override;
24  };
25  }
26 }
27 
28 // Implementation
29 
30 namespace l1t {
31  namespace stage1 {
32  Blocks
35  event.getByToken(static_cast<const CaloTokens*>(toks)->getCaloRegionToken(), caloregion);
36 
38  event.getByToken(static_cast<const CaloTokens*>(toks)->getCaloEmCandToken(), caloemcand);
39 
40  std::vector<uint32_t> load[36];
41 
42  for (int i = 0; i <= 0; ++i) {
43  int n = 0;
44  PhysicsToBitConverter converter[18];
45  for (auto j = caloregion->begin(); j != caloregion->end(); ++j, ++n) {
46 
47  int et=(int)j->et();
48  int overFlow=(int)j->overFlow();
49  int fineGrain=(int)j->fineGrain();
50  int mip=(int)j->mip();
51  //int quiet=(int)j->quiet();
52  int rctCrate=(int)j->rctCrate();
53  int rctCard=(int)j->rctCard();
54  int rctRegion=(int)j->rctRegionIndex();
55  bool isHf=(bool)j->isHf();
56 
57  if(!isHf){
58  converter[rctCrate].SetRCEt(et,rctCard,rctRegion);
59  converter[rctCrate].SetRCOf(overFlow,rctCard,rctRegion);
60  converter[rctCrate].SetRCTau(fineGrain,rctCard,rctRegion);
61  converter[rctCrate].SetRCHad(mip,rctCard,rctRegion);
62  LogDebug("L1T")<<"CRATE"<<rctCrate<<"region="<<rctRegion<<", card="<<rctCard<<", rgnEt="<<et<<", overflow="<<overFlow<<", tauveto="<<fineGrain<<", hadveto="<<mip<<std::endl;
63 
64  }
65  else{
66  converter[rctCrate].SetHFEt(et,rctRegion);
67  LogDebug("L1T")<<"CRATE"<<rctCrate<<"region="<<rctRegion<<", rgnEt="<<et<<std::endl;
68 
69  }
70  }//end calo region
71 
72  int m = 0;
73  for (auto j = caloemcand->begin(); j != caloemcand->end(); ++j, ++m) {
74 
75  int rank=(int)j->rank();
76  int index=(int)j->index();
77  int rctCrate=(int)j->rctCrate();
78  bool isolated=(bool)j->isolated();
79  int rctCard=(int)j->rctCard();
80  int rctRegion=(int)j->rctRegion();
81 
82  if(isolated){
83  converter[rctCrate].SetIEEt(rank,index);
84  converter[rctCrate].SetIEReg(rctRegion,index);
85  converter[rctCrate].SetIECard(rctCard,index);
86  LogDebug("L1T")<<"CRATE"<<rctCrate<<"ISO em rank="<<rank<<", region="<<rctRegion<<", card="<<rctCard<<std::endl;
87  }
88  else{
89  converter[rctCrate].SetNEEt(rank,index);
90  converter[rctCrate].SetNEReg(rctRegion,index);
91  converter[rctCrate].SetNECard(rctCard,index);
92  LogDebug("L1T")<<"CRATE"<<rctCrate<<"NON ISO em rank="<<rank<<", region="<<rctRegion<<", card="<<rctCard<<std::endl;
93  }
94  }//end of em cand
95 
96  for (int in=0;in<18;in++){
97  converter[in].Extract32bitwords();
98  for (int d=0;d<6;d++){
99  load[2*in].push_back((uint32_t)converter[in].Get32bitWordLinkEven(d));
100  load[2*in+1].push_back((uint32_t)converter[in].Get32bitWordLinkOdd(d));
101  }
102  }
103  }// end of BX
104 
105  rctDataBase database;
106 
107  Blocks res = {};
108 
109  for (int i = 0; i < 36; ++i) {
110  unsigned int mycrateRCT=(int)(i/2);
111  bool myRCTeven;
112  if (i%2==0) myRCTeven=true;
113  else myRCTeven=false;
114  int linkMP7=-1;
115  database.GetLinkMP7(mycrateRCT,myRCTeven,linkMP7);
116  res.push_back(Block(2*linkMP7, load[i], 0));
117  res.push_back(Block(2*linkMP7, load[i], 1));
118  }
119  return res;
120  }
121  }
122 }
#define LogDebug(id)
void SetNEReg(int value, int cand)
void GetLinkMP7(unsigned int RCTcrate, bool RCTeven, int &linkMP7)
Definition: rctDataBase.h:69
void SetNEEt(int value, int cand)
void SetRCOf(int value, int card, int region)
int i
Definition: DBlmapReader.cc:9
void SetHFEt(int value, int region)
void SetIEReg(int value, int cand)
void SetRCTau(int value, int card, int region)
void SetNECard(int value, int cand)
def load
Definition: svgfig.py:546
std::vector< Block > Blocks
Definition: Block.h:68
int j
Definition: DBlmapReader.cc:9
void SetRCEt(int value, int card, int region)
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
void SetIECard(int value, int cand)
void SetRCHad(int value, int card, int region)
void SetIEEt(int value, int cand)
#define DEFINE_L1T_PACKER(type)
Definition: Packer.h:36
virtual Blocks pack(const edm::Event &, const PackerTokens *) override