CMS 3D CMS Logo

TriggerSummaryProducerRAW.cc
Go to the documentation of this file.
1 
12 
22 
23 #include <memory>
24 #include <vector>
25 
26 //
27 // constructors and destructor
28 //
30  : pn_(ps.getParameter<std::string>("processName")) {
31  if (pn_ == "@") {
33  if (tns.isAvailable()) {
34  pn_ = tns->getProcessName();
35  } else {
36  edm::LogError("TriggerSummaryProducerRaw") << "HLT Error: TriggerNamesService not available!";
37  pn_ = "*";
38  }
39  }
40 
41  LogDebug("TriggerSummaryProducerRaw") << "Using process name: '" << pn_ << "'";
42  produces<trigger::TriggerEventWithRefs>();
43 
44  // Tell the getter what type of products to get and
45  // also the process to get them from
47  callWhenNewProductsRegistered(getterOfProducts_);
48 }
49 
51 
52 //
53 // member functions
54 //
55 
58  desc.add<std::string>("processName", "@");
59  descriptions.add("triggerSummaryProducerRAW", desc);
60 }
61 
62 // ------------ method called to produce the data ------------
64  using namespace std;
65  using namespace edm;
66  using namespace reco;
67  using namespace trigger;
68 
69  std::vector<edm::Handle<trigger::TriggerFilterObjectWithRefs> > fobs;
70  getterOfProducts_.fillHandles(iEvent, fobs);
71 
72  const unsigned int nfob(fobs.size());
73  LogDebug("TriggerSummaryProducerRaw") << "Number of filter objects found: " << nfob;
74 
75  // construct single RAW product
76  unique_ptr<TriggerEventWithRefs> product(new TriggerEventWithRefs(pn_, nfob));
77  for (unsigned int ifob = 0; ifob != nfob; ++ifob) {
78  const string& label(fobs[ifob].provenance()->moduleLabel());
79  const string& instance(fobs[ifob].provenance()->productInstanceName());
80  const string& process(fobs[ifob].provenance()->processName());
81  const InputTag tag(label, instance, process);
82  LogTrace("TriggerSummaryProducerRaw")
83  << ifob << " " << tag << endl
84  << " Sizes: "
85  << " 1/" << fobs[ifob]->photonSize() << " 2/" << fobs[ifob]->electronSize() << " 3/" << fobs[ifob]->muonSize()
86  << " 4/" << fobs[ifob]->jetSize() << " 5/" << fobs[ifob]->compositeSize() << " 6/" << fobs[ifob]->basemetSize()
87  << " 7/" << fobs[ifob]->calometSize()
88 
89  << " 8/" << fobs[ifob]->pixtrackSize() << " 9/" << fobs[ifob]->l1emSize() << " A/" << fobs[ifob]->l1muonSize()
90  << " B/" << fobs[ifob]->l1jetSize() << " C/" << fobs[ifob]->l1etmissSize() << " D/"
91  << fobs[ifob]->l1hfringsSize() << " E/" << fobs[ifob]->pfjetSize() << " F/" << fobs[ifob]->pftauSize() << " G/"
92  << fobs[ifob]->pfmetSize() << " I/" << fobs[ifob]->l1tmuonSize() << " J/" << fobs[ifob]->l1tegammaSize()
93  << " K/" << fobs[ifob]->l1tjetSize() << " L/" << fobs[ifob]->l1ttauSize() << " M/" << fobs[ifob]->l1tetsumSize()
94  << 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
119  OrphanHandle<TriggerEventWithRefs> ref = iEvent.put(std::move(product));
120  LogTrace("TriggerSummaryProducerRaw") << "Number of filter objects packed: " << ref->size();
121 
122  return;
123 }
#define LogDebug(id)
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:131
std::string const & getProcessName() const
static PFTauRenderPlugin instance
edm::GetterOfProducts< trigger::TriggerFilterObjectWithRefs > getterOfProducts_
void fillHandles(edm::Event const &event, std::vector< edm::Handle< T >> &handles) const
TriggerSummaryProducerRAW(const edm::ParameterSet &)
char const * label
int iEvent
Definition: GenABIO.cc:224
~TriggerSummaryProducerRAW() override
bool isAvailable() const
Definition: Service.h:40
ParameterDescriptionBase * add(U const &iLabel, T const &value)
#define LogTrace(id)
std::string pn_
process name
size_type size() const
number of filters
void add(std::string const &label, ParameterSetDescription const &psetDescription)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
fixed size matrix
HLT enums.
void produce(edm::Event &, const edm::EventSetup &) override
def move(src, dest)
Definition: eostools.py:511