CMS 3D CMS Logo

PixelTemplateSmearerBase.h
Go to the documentation of this file.
1 #ifndef FastSimulation_TrackingRecHitProducer_PixelTemplateSmearerBase_h
2 #define FastSimulation_TrackingRecHitProducer_PixelTemplateSmearerBase_h
3 
4 //---------------------------------------------------------------------------
9 //---------------------------------------------------------------------------
10 
11 // FastSim stuff
13 
14 //Framework
16 
17 // PSimHit
19 
20 // Geometry
23 // template object
25 
26 // Vectors
29 
30 // STL
31 #include <vector>
32 #include <string>
33 #include <memory>
34 
35 class TFile;
38 
41 {
42  public:
43  //--- Use this type to keep track of groups of hits that need to be merged:
44  struct MergeGroup{
45  std::vector<TrackingRecHitProduct::SimHitIdPair> group;
46  bool smearIt;
47  };
48 
49  protected:
50  bool mergeHitsOn;
51  std::vector< SiPixelTemplateStore > thePixelTemp_;
53 
54  bool isFlipped(const PixelGeomDetUnit* theDet) const;
55  //isForward, true for forward, false for barrel
56  bool isForward;
57 
59  unsigned int rescotAlpha_binN;
61  unsigned int rescotBeta_binN;
63  unsigned int resqbin_binN;
64 
65 
66  std::map<unsigned int, const SimpleHistogramGenerator*> theXHistos;
67  std::map<unsigned int, const SimpleHistogramGenerator*> theYHistos;
68 
69  std::unique_ptr<TFile> theEdgePixelResolutionFile;
71  std::unique_ptr<TFile> theBigPixelResolutionFile;
73  std::unique_ptr<TFile> theRegularPixelResolutionFile;
75  std::unique_ptr<TFile> theMergingProbabilityFile;
77  std::unique_ptr<TFile> theMergedPixelResolutionXFile;
79  std::unique_ptr<TFile> theMergedPixelResolutionYFile;
81 
82  unsigned int theLayer;
83 
84  public:
85 
86  explicit PixelTemplateSmearerBase( const std::string& name,
88  edm::ConsumesCollector& consumesCollector );
89 
90  virtual ~PixelTemplateSmearerBase();
92 
93  //--- Process all unmerged hits. Calls smearHit() for each.
95  std::vector<TrackingRecHitProduct::SimHitIdPair> & unmergedHits,
97  const PixelGeomDetUnit * detUnit,
98  const double boundX, const double boundY,
100  ) const;
101  //--- Process all groups of merged hits.
103  std::vector< MergeGroup* > & mergeGroups,
104  TrackingRecHitProductPtr product,
105  const PixelGeomDetUnit * detUnit,
106  const double boundX, const double boundY,
108  ) const;
109 
110 
111  //--- Process one umerged hit.
113  const PSimHit& simHit, const PixelGeomDetUnit* detUnit,
114  const double boundX, const double boundY,
116  const;
117 
118  //--- Process one merge group.
120  MergeGroup* mg,
121  const PixelGeomDetUnit * detUnit,
122  const double boundX, const double boundY,
124  ) const;
125 
126  //--- Method to decide if the two hits on the same DetUnit are merged, or not.
127  bool hitsMerge(const PSimHit& simHit1,const PSimHit& simHit2) const;
128 };
129 #endif
std::unique_ptr< TFile > theRegularPixelResolutionFile
std::unique_ptr< TFile > theEdgePixelResolutionFile
Definition: config.py:1
TRandom random
Definition: MVATrainer.cc:138
bool isFlipped(const PixelGeomDetUnit *theDet) const
FastSingleTrackerRecHit smearMergeGroup(MergeGroup *mg, const PixelGeomDetUnit *detUnit, const double boundX, const double boundY, const RandomEngineAndDistribution *random) const
std::unique_ptr< TFile > theMergingProbabilityFile
TrackingRecHitProductPtr processUnmergedHits(std::vector< TrackingRecHitProduct::SimHitIdPair > &unmergedHits, TrackingRecHitProductPtr product, const PixelGeomDetUnit *detUnit, const double boundX, const double boundY, RandomEngineAndDistribution const *random) const
bool hitsMerge(const PSimHit &simHit1, const PSimHit &simHit2) const
std::shared_ptr< TrackingRecHitProduct > TrackingRecHitProductPtr
std::unique_ptr< TFile > theMergedPixelResolutionXFile
virtual TrackingRecHitProductPtr process(TrackingRecHitProductPtr product) const
std::map< unsigned int, const SimpleHistogramGenerator * > theYHistos
std::map< unsigned int, const SimpleHistogramGenerator * > theXHistos
std::unique_ptr< TFile > theBigPixelResolutionFile
std::vector< SiPixelTemplateStore > thePixelTemp_
FastSingleTrackerRecHit smearHit(const PSimHit &simHit, const PixelGeomDetUnit *detUnit, const double boundX, const double boundY, RandomEngineAndDistribution const *) const
std::unique_ptr< TFile > theMergedPixelResolutionYFile
std::vector< TrackingRecHitProduct::SimHitIdPair > group
TrackingRecHitProductPtr processMergeGroups(std::vector< MergeGroup * > &mergeGroups, TrackingRecHitProductPtr product, const PixelGeomDetUnit *detUnit, const double boundX, const double boundY, RandomEngineAndDistribution const *random) const
PixelTemplateSmearerBase(const std::string &name, const edm::ParameterSet &config, edm::ConsumesCollector &consumesCollector)