CMS 3D CMS Logo

CosmicGenFilterHelix.h
Go to the documentation of this file.
1 
18 
22 
25 
30 
32 
33 #include <TObjArray.h>
34 
35 #include <vector>
36 
37 class MagneticField;
38 class Propagator;
39 
40 class CosmicGenFilterHelix : public edm::one::EDFilter<edm::one::SharedResources> {
41  public:
43  ~CosmicGenFilterHelix() override;
44 
45  void beginJob() override;
46  bool filter(edm::Event &event, const edm::EventSetup &eventSetup) override;
47  void endJob() override;
48 
49  private:
51  bool propagateToCutCylinder(const GlobalPoint &vertStart, const GlobalVector &momStart,
52  int charge, const MagneticField *field,
53  const Propagator *propagator); //non-const: monitorEnd
55  bool charge(int id, int &charge) const;
58  const Propagator* getPropagator(const edm::EventSetup &setup) const;
59 // ----------member data ---------------------------
60 
62  const std::vector<int> theIds;
63  const std::vector<int> theCharges;
64  const std::string thePropagatorName; // tag to get propagator from ESetup
65  const double theMinP2;
66  const double theMinPt2;
67 
71 
72  unsigned int theNumTotal;
73  unsigned int theNumPass;
74 
75  // for monitoring:
76  void createHistsStart(const char *dirName, TObjArray &hists);
77  void createHistsEnd(const char *dirName, TObjArray &hists);
78  void monitorStart(const GlobalPoint &vert, const GlobalVector &mom, int charge,TObjArray &hists);
79  void monitorEnd(const GlobalPoint &endVert, const GlobalVector &endMom,
80  const GlobalPoint &vert, const GlobalVector &mom, double path, TObjArray &hists);
81  bool equidistLogBins(double* bins, int nBins, double first, double last) const;
82  const bool theDoMonitor;
83  TObjArray theHistsBefore;
84  TObjArray theHistsAfter;
85 
86 };
Cylinder::ConstCylinderPointer theTargetCylinder
minimal transverse^2 momentum after propagation to cylinder
unsigned int theNumPass
for final statistics: all seen events
Plane::ConstPlanePointer theTargetPlaneMax
plane closing cylinder at &#39;negative&#39; side
const double theMinPt2
minimal momentum^2 after propagation to cylinder
const std::vector< int > theIds
const Propagator * getPropagator(const edm::EventSetup &setup) const
TObjArray theHistsAfter
hists of properties from generator
void createHistsStart(const char *dirName, TObjArray &hists)
for final statistics: events with track reaching target
def setup(process, global_tag, zero_tesla=False)
Definition: GeneralSetup.py:2
const MagneticField * getMagneticField(const edm::EventSetup &setup) const
provide magnetic field from Event Setup
Definition: config.py:1
bool propagateToCutCylinder(const GlobalPoint &vertStart, const GlobalVector &momStart, int charge, const MagneticField *field, const Propagator *propagator)
actually propagate to the defined cylinder
edm::EDGetTokenT< edm::HepMCProduct > theSrcToken
void monitorEnd(const GlobalPoint &endVert, const GlobalVector &endMom, const GlobalPoint &vert, const GlobalVector &mom, double path, TObjArray &hists)
CosmicGenFilterHelix(const edm::ParameterSet &config)
const std::vector< int > theCharges
requested Ids
bool equidistLogBins(double *bins, int nBins, double first, double last) const
void createHistsEnd(const char *dirName, TObjArray &hists)
TObjArray theHistsBefore
whether or not to fill monitor hists (needs TFileService)
bool charge(int id, int &charge) const
true if ID selected, return by value its charge
void monitorStart(const GlobalPoint &vert, const GlobalVector &mom, int charge, TObjArray &hists)
const std::string thePropagatorName
charges, parallel to theIds
bool filter(edm::Event &event, const edm::EventSetup &eventSetup) override
Plane::ConstPlanePointer theTargetPlaneMin
target cylinder, around z-axis
Definition: event.py:1
unsigned int theNumTotal
plane closing cylinder at &#39;positive&#39; side