CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
HLTTrackSeedMultiplicityFilter.cc
Go to the documentation of this file.
2 
3 //
4 // class declaration
5 //
6 
8 public:
11 
12 private:
13  virtual bool hltFilter(edm::Event&, const edm::EventSetup&, trigger::TriggerFilterObjectWithRefs & filterproduct);
14 
15  edm::InputTag inputTag_; // input tag identifying product containing track seeds
16  unsigned int min_seeds_; // minimum number of track seeds
17  unsigned int max_seeds_; // maximum number of track seeds
18 
19 };
20 
29 
30 //
31 // constructors and destructor
32 //
33 
35  inputTag_ (config.getParameter<edm::InputTag>("inputTag")),
36  min_seeds_ (config.getParameter<unsigned int>("minSeeds")),
37  max_seeds_ (config.getParameter<unsigned int>("maxSeeds"))
38 {
39  LogDebug("") << "Using the " << inputTag_ << " input collection";
40  LogDebug("") << "Requesting at least " << min_seeds_ << " seeds";
41  if(max_seeds_ > 0)
42  LogDebug("") << "...but no more than " << max_seeds_ << " seeds";
43 }
44 
46 {
47 }
48 
49 //
50 // member functions
51 //
52 
53 // ------------ method called to produce the data ------------
55 {
56  // All HLT filters must create and fill an HLT filter object,
57  // recording any reconstructed physics objects satisfying (or not)
58  // this HLT filter, and place it in the Event.
59 
60  // The filter object
61  if (saveTags()) filterproduct.addCollectionTag(inputTag_);
62 
63  // get hold of products from Event
65  event.getByLabel(inputTag_, seedColl);
66 
67  const TrajectorySeedCollection *rsSeedCollection = 0;
68 
69 
70  if( seedColl.isValid() )
71  {
72  //std::cout << "Problem!!" << std::endl;
73  rsSeedCollection = seedColl.product();
74  }
75  else
76  {
77  return false;
78  }
79 
80 
81  // Number of trakc seeds in the collection
82 
83  unsigned int seedsize = rsSeedCollection->size();
84 
85 
86  LogDebug("") << "Number of seeds: " << seedsize;
87 
88  // Apply the filter cuts
89 
90  bool accept = (seedsize >= min_seeds_);
91 
92  if(max_seeds_ > 0)
93  accept &= (seedsize <= max_seeds_);
94 
95  // return with final filter decision
96  return accept;
97 }
98 
99 // define as a framework module
#define LogDebug(id)
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
HLTTrackSeedMultiplicityFilter(const edm::ParameterSet &)
bool accept(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
Definition: TopDQMHelpers.h:22
std::vector< TrajectorySeed > TrajectorySeedCollection
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
bool isValid() const
Definition: HandleBase.h:76
void addCollectionTag(const edm::InputTag &collectionTag)
collectionTags
T const * product() const
Definition: Handle.h:74
bool saveTags() const
Definition: HLTFilter.h:45
virtual bool hltFilter(edm::Event &, const edm::EventSetup &, trigger::TriggerFilterObjectWithRefs &filterproduct)