CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
FastSimDataFilter.cc
Go to the documentation of this file.
2 
14 
15 
16 using namespace std;
17 namespace cms
18 {
19 
20 FastSimDataFilter::FastSimDataFilter(const edm::ParameterSet& conf)
21 {
22  towercut= conf.getUntrackedParameter<double>("towercut", 1.4);
23 }
24 
25 FastSimDataFilter::~FastSimDataFilter() {}
26 
27 void FastSimDataFilter::beginJob() { ntotal = 0; npassed = 0; }
28 void FastSimDataFilter::endJob() {
29  cout << " FastSimDataFilter: accepted " << npassed << " out of total "
30  << ntotal << endl;
31 
32  }
33 
35 {
36  ntotal++;
37  bool result = false;
38 
40  event.getByLabel("towerMaker",towers);
42 
43 
44  int nplusP = 0;
45  int nminusP = 0;
46  int nplusR = 0;
47  int nminusR = 0;
48  double metx = 0.;
49  double mety = 0.;
50  double sumEt = 0.;
51 
52  for ( cal = towers->begin(); cal != towers->end(); ++cal ) {
53 
54  // double eE = cal->emEnergy();
55  // double eH = cal->hadEnergy();
56  // double eHO = cal->outerEnergy();
57  // double phi = cal->phi();
58 
59  double eta = cal->eta();
60  double en = cal->energy();
61  double et = cal->et();
62 
63  // cylindrical
64  math::RhoEtaPhiVector mom(cal->et(), cal->eta(), cal->phi());
65 
66  /*
67  // cell properties
68  CaloTowerDetId idT = cal->id();
69  int ieta = idT.ieta();
70  if(ieta > 0) ieta -= 1;
71  int iphi = idT.iphi();
72  */
73 
74  metx += mom.x();
75  mety += mom.y();
76  sumEt += et;
77 
78  // Towers approx. in the region of BSC Paddles and Rings
79  if( en > towercut && eta > 3.1 && eta < 3.5 ) nplusP++;
80  if( en > towercut && eta < -3.1 && eta > -3.5 ) nminusP++;
81  if( en > towercut && eta > 3.9 && eta < 4.6 ) nplusR++;
82  if( en > towercut && eta < -3.9 && eta > -4.6 ) nminusR++;
83 
84 
85  } // towers cycle
86 
87  if( (nplusP * nminusP >= 1 ) || (nplusR * nminusR >= 1 ) ||
88  (nplusP * nminusR >= 1 ) || (nplusR * nminusP >= 1 )) {
89  // std::cout << "... passed" << std::endl;
90  result = true;
91  npassed++;
92  }
93 
94  return result;
95 
96 }
97 } // namespace cms
98 
99 // define this class as a plugin
101 using namespace cms;
T getUntrackedParameter(std::string const &, T const &) const
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
std::vector< CaloTower >::const_iterator const_iterator
RhoEtaPhiVectorD RhoEtaPhiVector
spatial vector with cylindrical internal representation using pseudorapidity
Definition: Vector3D.h:32
void beginJob()
Definition: Breakpoints.cc:15
tuple result
Definition: query.py:137
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
tuple conf
Definition: dbtoconf.py:185
tuple cout
Definition: gather_cfg.py:121
void setup(std::vector< TH2F > &depth, std::string name, std::string units="")