CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
TriggerSummaryProducerRAW.cc
Go to the documentation of this file.
1 
12 
21 
22 #include <memory>
23 #include <vector>
24 
25 //
26 // constructors and destructor
27 //
29  : pn_(ps.getParameter<std::string>("processName")), putToken_{produces<trigger::TriggerEventWithRefs>()} {
30  if (pn_ == "@") {
32  if (tns.isAvailable()) {
33  pn_ = tns->getProcessName();
34  } else {
35  edm::LogError("TriggerSummaryProducerRaw") << "HLT Error: TriggerNamesService not available!";
36  pn_ = "*";
37  }
38  }
39 
40  LogDebug("TriggerSummaryProducerRaw") << "Using process name: '" << pn_ << "'";
41 
42  // Tell the getter what type of products to get and
43  // also the process to get them from
46 }
47 
49 
50 //
51 // member functions
52 //
53 
56  desc.add<std::string>("processName", "@");
57  descriptions.add("triggerSummaryProducerRAW", desc);
58 }
59 
60 // ------------ method called to produce the data ------------
62  using namespace std;
63  using namespace edm;
64  using namespace reco;
65  using namespace trigger;
66 
67  std::vector<edm::Handle<trigger::TriggerFilterObjectWithRefs> > fobs;
68  getterOfProducts_.fillHandles(iEvent, fobs);
69 
70  const unsigned int nfob(fobs.size());
71  LogDebug("TriggerSummaryProducerRaw") << "Number of filter objects found: " << nfob;
72 
73  // construct single RAW product
74  TriggerEventWithRefs product(pn_, nfob);
75  for (unsigned int ifob = 0; ifob != nfob; ++ifob) {
76  const string& label(fobs[ifob].provenance()->moduleLabel());
77  const string& instance(fobs[ifob].provenance()->productInstanceName());
78  const string& process(fobs[ifob].provenance()->processName());
79  const InputTag tag(label, instance, process);
80  LogTrace("TriggerSummaryProducerRaw")
81  << ifob << " " << tag << endl
82  << " Sizes: "
83  << " 1/" << fobs[ifob]->photonSize() << " 2/" << fobs[ifob]->electronSize() << " 3/" << fobs[ifob]->muonSize()
84  << " 4/" << fobs[ifob]->jetSize() << " 5/" << fobs[ifob]->compositeSize() << " 6/" << fobs[ifob]->basemetSize()
85  << " 7/" << fobs[ifob]->calometSize()
86 
87  << " 8/" << fobs[ifob]->pixtrackSize() << " 9/" << fobs[ifob]->l1emSize() << " A/" << fobs[ifob]->l1muonSize()
88  << " B/" << fobs[ifob]->l1jetSize() << " C/" << fobs[ifob]->l1etmissSize() << " D/"
89  << fobs[ifob]->l1hfringsSize() << " E/" << fobs[ifob]->pfjetSize() << " F/" << fobs[ifob]->pftauSize() << " G/"
90  << fobs[ifob]->pfmetSize() << " I/" << fobs[ifob]->l1tmuonSize() << " J/" << fobs[ifob]->l1tegammaSize()
91  << " K/" << fobs[ifob]->l1tjetSize() << " L/" << fobs[ifob]->l1ttauSize() << " M/" << fobs[ifob]->l1tetsumSize()
92  << " N/" << fobs[ifob]->l1ttkmuonSize() << " O/" << fobs[ifob]->l1ttkeleSize() << " P/"
93  << fobs[ifob]->l1ttkemSize() << " Q/" << fobs[ifob]->l1tpfjetSize() << " R/" << fobs[ifob]->l1tpftauSize()
94  << " S/" << fobs[ifob]->l1thpspftauSize() << " T/" << fobs[ifob]->l1tpftrackSize() << endl;
95  LogTrace("TriggerSummaryProducerRaw")
96  << "TriggerSummaryProducerRaw::addFilterObjects( )"
97  << "\n fobs[ifob]->l1tmuonIds().size() = " << fobs[ifob]->l1tmuonIds().size()
98  << "\n fobs[ifob]->l1tmuonRefs().size() = " << fobs[ifob]->l1tmuonRefs().size() << endl;
99  LogTrace("TriggerSummaryProducerRaw")
100  << "TriggerSummaryProducerRaw::addFilterObjects( )"
101  << "\n fobs[ifob]->l1tegammaIds().size() = " << fobs[ifob]->l1tegammaIds().size()
102  << "\n fobs[ifob]->l1tegammaRefs().size() = " << fobs[ifob]->l1tegammaRefs().size() << endl;
103  LogTrace("TriggerSummaryProducerRaw")
104  << "TriggerSummaryProducerRaw::addFilterObjects( )"
105  << "\n fobs[ifob]->l1tjetIds().size() = " << fobs[ifob]->l1tjetIds().size()
106  << "\n fobs[ifob]->l1tjetRefs().size() = " << fobs[ifob]->l1tjetRefs().size() << endl;
107  LogTrace("TriggerSummaryProducerRaw")
108  << "TriggerSummaryProducerRaw::addFilterObjects( )"
109  << "\n fobs[ifob]->l1ttauIds().size() = " << fobs[ifob]->l1ttauIds().size()
110  << "\n fobs[ifob]->l1ttauRefs().size() = " << fobs[ifob]->l1ttauRefs().size() << endl;
111  LogTrace("TriggerSummaryProducerRaw")
112  << "TriggerSummaryProducerRaw::addFilterObjects( )"
113  << "\n fobs[ifob]->l1tetsumIds().size() = " << fobs[ifob]->l1tetsumIds().size()
114  << "\n fobs[ifob]->l1tetsumRefs().size() = " << fobs[ifob]->l1tetsumRefs().size() << endl;
115  product.addFilterObject(tag, *fobs[ifob]);
116  }
117 
118  // place product in Event
120  LogTrace("TriggerSummaryProducerRaw") << "Number of filter objects packed: " << ref->size();
121 
122  return;
123 }
void callWhenNewProductsRegistered(std::function< void(BranchDescription const &)> const &func)
Definition: ProducerBase.h:85
pathNames_ & tns()), endPathNames_(&tns.getEndPaths()), wantSummary_(tns.wantSummary()
Definition: Schedule.cc:691
std::string const & getProcessName() const
void addFilterObject(const edm::InputTag &filterTag, const TriggerFilterObjectWithRefs &tfowr)
setters - to build EDProduct
static PFTauRenderPlugin instance
const edm::EDPutTokenT< trigger::TriggerEventWithRefs > putToken_
edm::GetterOfProducts< trigger::TriggerFilterObjectWithRefs > getterOfProducts_
void fillHandles(edm::Event const &event, std::vector< edm::Handle< T >> &handles) const
TriggerSummaryProducerRAW(const edm::ParameterSet &)
Log< level::Error, false > LogError
#define LogTrace(id)
char const * label
int iEvent
Definition: GenABIO.cc:224
~TriggerSummaryProducerRAW() override
def move
Definition: eostools.py:511
bool isAvailable() const
Definition: Service.h:40
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void produce(edm::StreamID, edm::Event &, const edm::EventSetup &) const override
std::string pn_
process name
OrphanHandle< PROD > emplace(EDPutTokenT< PROD > token, Args &&...args)
puts a new product
Definition: Event.h:433
void add(std::string const &label, ParameterSetDescription const &psetDescription)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
tuple process
Definition: LaserDQM_cfg.py:3
#define LogDebug(id)