CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Classes | Public Member Functions | Public Attributes
l1t::GtInputDump Class Reference
Inheritance diagram for l1t::GtInputDump:
edm::EDAnalyzer edm::EDConsumerBase

Classes

class  cc
 

Public Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &)
 
 GtInputDump (const edm::ParameterSet &)
 
virtual ~GtInputDump ()
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Public Attributes

EDGetToken egToken
 
EDGetToken etsumToken
 
EDGetToken jetToken
 
int m_maxBx
 
int m_minBx
 
EDGetToken muToken
 
EDGetToken tauToken
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

Definition at line 56 of file GtInputDump.cc.

Constructor & Destructor Documentation

l1t::GtInputDump::GtInputDump ( const edm::ParameterSet iConfig)
explicit

Definition at line 72 of file GtInputDump.cc.

References edm::ParameterSet::getParameter().

73  {
74  egToken = consumes<BXVector<l1t::EGamma>>(iConfig.getParameter<InputTag>("egInputTag"));
75  muToken = consumes<BXVector<l1t::Muon>>(iConfig.getParameter<InputTag>("muInputTag"));
76  tauToken = consumes<BXVector<l1t::Tau>>(iConfig.getParameter<InputTag>("tauInputTag"));
77  jetToken = consumes<BXVector<l1t::Jet>>(iConfig.getParameter<InputTag>("jetInputTag"));
78  etsumToken = consumes<BXVector<l1t::EtSum>>(iConfig.getParameter<InputTag>("etsumInputTag"));
79 
80  m_minBx = iConfig.getParameter<int>("minBx");
81  m_maxBx = iConfig.getParameter<int>("maxBx");
82 
83 
84  }
EDGetToken muToken
Definition: GtInputDump.cc:63
T getParameter(std::string const &) const
EDGetToken jetToken
Definition: GtInputDump.cc:65
EDGetToken egToken
Definition: GtInputDump.cc:62
EDGetToken tauToken
Definition: GtInputDump.cc:64
EDGetToken etsumToken
Definition: GtInputDump.cc:66
virtual l1t::GtInputDump::~GtInputDump ( )
inlinevirtual

Definition at line 59 of file GtInputDump.cc.

59 {};

Member Function Documentation

void l1t::GtInputDump::analyze ( const edm::Event iEvent,
const edm::EventSetup evSetup 
)
virtual

Implements edm::EDAnalyzer.

Definition at line 87 of file GtInputDump.cc.

References gather_cfg::cout, TauDecayModes::dec, edm::Event::getByToken(), i, edm::HandleBase::isValid(), metsig::jet, fwrapper::jets, RPCpg::mu, patZpeak::muons, and metsig::tau.

87  {
88 
89 
90  //inputs
92  iEvent.getByToken(egToken,egammas);
93 
95  iEvent.getByToken(muToken,muons);
96 
98  iEvent.getByToken(tauToken,taus);
99 
101  iEvent.getByToken(jetToken,jets);
102 
104  iEvent.getByToken(etsumToken,etsums);
105 
106  printf("\n -------------------------------------- \n");
107  printf(" *********** New Event ************** \n");
108  printf(" -------------------------------------- \n");
109  //Loop over BX
110  //Loop over BX
111  for(int i =m_minBx; i <= m_maxBx; ++i) {
112 
113  cout << " ========== BX = " << std::dec << i << " =============================" << endl;
114 
115  //Loop over EGamma
116  int nObj =0;
117  cout << " ------ EGammas -------- " << endl;
118  if (egammas.isValid()) {
119  if(i>=egammas->getFirstBX() && i<=egammas->getLastBX()) {
120  for(std::vector<l1t::EGamma>::const_iterator eg = egammas->begin(i); eg != egammas->end(i); ++eg) {
121  cout << " " << std::dec << std::setw(2) << std::setfill(' ') << nObj << std::setfill('0')<< ")";
122  cout << " Pt " << std::dec << std::setw(3) << eg->hwPt() << " (0x" << std::hex << std::setw(3) << std::setfill('0') << eg->hwPt() << ")";
123  cout << " Eta " << std::dec << std::setw(3) << eg->hwEta() << " (0x" << std::hex << std::setw(2) << std::setfill('0') << (eg->hwEta()&0xff) << ")";
124  cout << " Phi " << std::dec << std::setw(3) << eg->hwPhi() << " (0x" << std::hex << std::setw(2) << std::setfill('0') << eg->hwPhi() << ")";
125  cout << " Iso " << std::dec << std::setw(1) << eg->hwIso() ;
126  cout << " Qual "<< std::dec << std::setw(1) << eg->hwQual() ;
127  cout << endl;
128  nObj++;
129  }
130  } else {
131  cout << "No EG stored for this bx " << i << endl;
132  }
133  } else {
134  cout << "No EG Data in this event " << endl;
135  }
136 
137  //Loop over Muons
138  nObj =0;
139  cout << " ------ Muons --------" << endl;
140  if (muons.isValid()) {
141  if(i>=muons->getFirstBX() && i<=muons->getLastBX()) {
142  for(std::vector<l1t::Muon>::const_iterator mu = muons->begin(i); mu != muons->end(i); ++mu) {
143  cout << " " << std::dec << std::setw(2) << std::setfill(' ') << nObj << std::setfill('0')<< ")";
144  cout << " Pt " << std::dec << std::setw(3) << mu->hwPt() << " (0x" << std::hex << std::setw(3) << std::setfill('0') << mu->hwPt() << ")";
145  cout << " Eta " << std::dec << std::setw(3) << mu->hwEta() << " (0x" << std::hex << std::setw(3) << std::setfill('0') << (mu->hwEta()&0x1ff) << ")";
146  cout << " Phi " << std::dec << std::setw(3) << mu->hwPhi() << " (0x" << std::hex << std::setw(3) << std::setfill('0') << mu->hwPhi() << ")";
147  cout << " Iso " << std::dec << std::setw(1) << mu->hwIso() ;
148  cout << " Qual "<< std::dec << std::setw(1) << mu->hwQual() ;
149  cout << endl;
150  nObj++;
151  }
152  }else {
153  cout << "No Muons stored for this bx " << i << endl;
154  }
155  } else {
156  cout << "No Muon Data in this event " << endl;
157  }
158 
159  //Loop over Taus
160  nObj =0;
161  cout << " ------ Taus ----------" << endl;
162  if(taus.isValid()) {
163  if(i>=taus->getFirstBX() && i<=taus->getLastBX()) {
164  for(std::vector<l1t::Tau>::const_iterator tau = taus->begin(i); tau != taus->end(i); ++tau) {
165  cout << " " << std::dec << std::setw(2) << std::setfill(' ') << nObj << std::setfill('0')<< ")";
166  cout << " Pt " << std::dec << std::setw(3) << tau->hwPt() << " (0x" << std::hex << std::setw(3) << std::setfill('0') << tau->hwPt() << ")";
167  cout << " Eta " << std::dec << std::setw(3) << tau->hwEta() << " (0x" << std::hex << std::setw(2) << std::setfill('0') << (tau->hwEta()&0xff) << ")";
168  cout << " Phi " << std::dec << std::setw(3) << tau->hwPhi() << " (0x" << std::hex << std::setw(2) << std::setfill('0') << tau->hwPhi() << ")";
169  cout << " Iso " << std::dec << std::setw(1) << tau->hwIso() ;
170  cout << " Qual "<< std::dec << std::setw(1) << tau->hwQual() ;
171  cout << endl;
172  nObj++;
173  }
174  } else {
175  cout << "No Taus stored for this bx " << i << endl;
176  }
177  } else {
178  cout << "No Tau Data in this event " << endl;
179  }
180 
181  //Loop over Jets
182  nObj =0;
183  cout << " ------ Jets ----------" << endl;
184  if(jets.isValid()) {
185  if(i>=jets->getFirstBX() && i<=jets->getLastBX()) {
186  for(std::vector<l1t::Jet>::const_iterator jet = jets->begin(i); jet != jets->end(i); ++jet) {
187  cout << " " << std::dec << std::setw(2) << std::setfill(' ') << nObj << std::setfill('0')<< ")";
188  cout << " Pt " << std::dec << std::setw(3) << jet->hwPt() << " (0x" << std::hex << std::setw(3) << std::setfill('0') << jet->hwPt() << ")";
189  cout << " Eta " << std::dec << std::setw(3) << jet->hwEta() << " (0x" << std::hex << std::setw(2) << std::setfill('0') << (jet->hwEta()&0xff) << ")";
190  cout << " Phi " << std::dec << std::setw(3) << jet->hwPhi() << " (0x" << std::hex << std::setw(2) << std::setfill('0') << jet->hwPhi() << ")";
191  cout << " Qual "<< std::dec << std::setw(1) << jet->hwQual() ;
192  cout << endl;
193  nObj++;
194  }
195  } else {
196  cout << "No Jets stored for this bx " << i << endl;
197  }
198  } else {
199  cout << "No jet Data in this event " << endl;
200  }
201 
202  //Dump Content
203  cout << " ------ EtSums ----------" << endl;
204  if(etsums.isValid()) {
205  if(i>=etsums->getFirstBX() && i<=etsums->getLastBX()) {
206  for(std::vector<l1t::EtSum>::const_iterator etsum = etsums->begin(i); etsum != etsums->end(i); ++etsum) {
207  switch ( etsum->getType() ) {
208  case l1t::EtSum::EtSumType::kMissingEt:
209  cout << " ETM: ";
210  break;
211  case l1t::EtSum::EtSumType::kMissingHt:
212  cout << " HTM: ";
213  break;
214  case l1t::EtSum::EtSumType::kTotalEt:
215  cout << " ETT: ";
216  break;
217  case l1t::EtSum::EtSumType::kTotalHt:
218  cout << " HTT: ";
219  break;
220  default:
221  cout << " Unknown: ";
222  break;
223  }
224  cout << " Et " << std::dec << std::setw(3) << etsum->hwPt() << " (0x" << std::hex << std::setw(3) << std::setfill('0') << etsum->hwPt() << ")";
225  if(etsum->getType() == l1t::EtSum::EtSumType::kMissingEt || etsum->getType() == l1t::EtSum::EtSumType::kMissingHt)
226  cout << " Phi " << std::dec << std::setw(3) << etsum->hwPhi() << " (0x" << std::hex << std::setw(2) << std::setfill('0') << etsum->hwPhi() << ")";
227  cout << endl;
228  }
229  } else {
230  cout << "No EtSums stored for this bx " << i << endl;
231  }
232  } else {
233  cout << "No EtSum Data in this event " << endl;
234  }
235 
236  }
237  printf("\n");
238  }
EDGetToken muToken
Definition: GtInputDump.cc:63
int i
Definition: DBlmapReader.cc:9
EDGetToken jetToken
Definition: GtInputDump.cc:65
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:446
vector< PseudoJet > jets
const int mu
Definition: Constants.h:22
bool isValid() const
Definition: HandleBase.h:76
EDGetToken egToken
Definition: GtInputDump.cc:62
tuple muons
Definition: patZpeak.py:38
tuple cout
Definition: gather_cfg.py:121
EDGetToken tauToken
Definition: GtInputDump.cc:64
EDGetToken etsumToken
Definition: GtInputDump.cc:66

Member Data Documentation

EDGetToken l1t::GtInputDump::egToken

Definition at line 62 of file GtInputDump.cc.

EDGetToken l1t::GtInputDump::etsumToken

Definition at line 66 of file GtInputDump.cc.

EDGetToken l1t::GtInputDump::jetToken

Definition at line 65 of file GtInputDump.cc.

int l1t::GtInputDump::m_maxBx

Definition at line 69 of file GtInputDump.cc.

int l1t::GtInputDump::m_minBx

Definition at line 68 of file GtInputDump.cc.

EDGetToken l1t::GtInputDump::muToken

Definition at line 63 of file GtInputDump.cc.

EDGetToken l1t::GtInputDump::tauToken

Definition at line 64 of file GtInputDump.cc.