CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
GtInputDump.cc
Go to the documentation of this file.
1 
12 
13 //
14 // This simple module simply retreives the YellowParams object from the event
15 // setup, and sends its payload as an INFO message, for debugging purposes.
16 //
17 
18 
20 
22 //#include "FWCore/ParameterSet/interface/InputTag.h"
23 
24 // system include files
25 #include <iomanip>
26 
27 // user include files
28 // base class
30 
38 
39 
45 
46 
49 
50 using namespace edm;
51 using namespace std;
52 
53 namespace l1t {
54 
55  // class declaration
56  class GtInputDump : public edm::EDAnalyzer {
57  public:
58  explicit GtInputDump(const edm::ParameterSet&);
59  virtual ~GtInputDump(){};
60  virtual void analyze(const edm::Event&, const edm::EventSetup&);
61 
67  };
68 
69  GtInputDump::GtInputDump(const edm::ParameterSet& iConfig)
70  {
71  egToken = consumes<BXVector<l1t::EGamma>>(iConfig.getParameter<InputTag>("egInputTag"));
72  muToken = consumes<BXVector<l1t::Muon>>(iConfig.getParameter<InputTag>("muInputTag"));
73  tauToken = consumes<BXVector<l1t::Tau>>(iConfig.getParameter<InputTag>("tauInputTag"));
74  jetToken = consumes<BXVector<l1t::Jet>>(iConfig.getParameter<InputTag>("jetInputTag"));
75  etsumToken = consumes<BXVector<l1t::EtSum>>(iConfig.getParameter<InputTag>("etsumInputTag"));
76  }
77 
78  // loop over events
79  void GtInputDump::analyze(const edm::Event& iEvent, const edm::EventSetup& evSetup){
80 
81 
82  //inputs
84  iEvent.getByToken(egToken,egammas);
85 
87  iEvent.getByToken(muToken,muons);
88 
90  iEvent.getByToken(tauToken,taus);
91 
93  iEvent.getByToken(jetToken,jets);
94 
96  iEvent.getByToken(etsumToken,etsums);
97 
98  printf("\n -------------------------------------- \n");
99  printf(" *********** New Event ************** \n");
100  printf(" -------------------------------------- \n");
101  //Loop over BX
102  for(int i = egammas->getFirstBX(); i <= egammas->getLastBX(); ++i) {
103 
104  printf("\n ========== BX %i =============================\n",i);
105 
106  //Loop over EGamma
107  printf(" ------ EGammas --------\n");
108  for(std::vector<l1t::EGamma>::const_iterator eg = egammas->begin(i); eg != egammas->end(i); ++eg) {
109  printf(" Pt %i Eta %i Phi %i Qual %i Isol %i\n",eg->hwPt(),eg->hwEta(),eg->hwPhi(),eg->hwQual(),eg->hwIso());
110  }
111 
112  //Loop over Muons
113  printf("\n ------ Muons --------\n");
114  for(std::vector<l1t::Muon>::const_iterator mu = muons->begin(i); mu != muons->end(i); ++mu) {
115  printf(" Pt %i Eta %i Phi %i Qual %i Iso %i \n",mu->hwPt(),mu->hwEta(),mu->hwPhi(),mu->hwQual(),mu->hwIso());
116  }
117 
118  //Loop over Taus
119  printf("\n ------ Taus ----------\n");
120  for(std::vector<l1t::Tau>::const_iterator tau = taus->begin(i); tau != taus->end(i); ++tau) {
121  printf(" Pt %i Eta %i Phi %i Qual %i Iso %i \n",tau->hwPt(),tau->hwEta(),tau->hwPhi(),tau->hwQual(),tau->hwIso());
122  }
123 
124  //Loop over Jets
125  printf("\n ------ Jets ----------\n");
126  for(std::vector<l1t::Jet>::const_iterator jet = jets->begin(i); jet != jets->end(i); ++jet) {
127  printf(" Pt %i Eta %i Phi %i Qual %i \n",jet->hwPt(),jet->hwEta(),jet->hwPhi(),jet->hwQual());
128  }
129  //Dump Content
130  printf("\n ------ EtSums ----------\n");
131  for(std::vector<l1t::EtSum>::const_iterator etsum = etsums->begin(i); etsum != etsums->end(i); ++etsum) {
132  printf(" Pt %i Eta %i Phi %i Qual %i \n",etsum->hwPt(),etsum->hwEta(),etsum->hwPhi(),etsum->hwQual());
133  }
134 
135 
136  }
137  printf("\n");
138  }
139 
140 }
141 
142 
144 
EDGetToken muToken
Definition: GtInputDump.cc:63
T getParameter(std::string const &) const
int i
Definition: DBlmapReader.cc:9
EDGetToken jetToken
Definition: GtInputDump.cc:65
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:434
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
virtual ~GtInputDump()
Definition: GtInputDump.cc:59
int iEvent
Definition: GenABIO.cc:230
vector< PseudoJet > jets
const int mu
Definition: Constants.h:22
EDGetToken egToken
Definition: GtInputDump.cc:62
tuple muons
Definition: patZpeak.py:38
EDGetToken tauToken
Definition: GtInputDump.cc:64
EDGetToken etsumToken
Definition: GtInputDump.cc:66