CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions
PixelForwardTemplateSmearerPlugin Class Reference
Inheritance diagram for PixelForwardTemplateSmearerPlugin:
PixelTemplateSmearerBase TrackingRecHitAlgorithm

Public Member Functions

 PixelForwardTemplateSmearerPlugin (const std::string &name, const edm::ParameterSet &config, edm::ConsumesCollector &consumesCollector)
 
virtual ~PixelForwardTemplateSmearerPlugin ()
 
- Public Member Functions inherited from PixelTemplateSmearerBase
bool hitsMerge (const PSimHit &simHit1, const PSimHit &simHit2) const
 
 PixelTemplateSmearerBase (const std::string &name, const edm::ParameterSet &config, edm::ConsumesCollector &consumesCollector)
 
virtual TrackingRecHitProductPtr process (TrackingRecHitProductPtr product) const
 
TrackingRecHitProductPtr processMergeGroups (std::vector< MergeGroup * > &mergeGroups, TrackingRecHitProductPtr product, const PixelGeomDetUnit *detUnit, const double boundX, const double boundY, RandomEngineAndDistribution const *random) const
 
TrackingRecHitProductPtr processUnmergedHits (std::vector< TrackingRecHitProduct::SimHitIdPair > &unmergedHits, TrackingRecHitProductPtr product, const PixelGeomDetUnit *detUnit, const double boundX, const double boundY, RandomEngineAndDistribution const *random) const
 
FastSingleTrackerRecHit smearHit (const PSimHit &simHit, const PixelGeomDetUnit *detUnit, const double boundX, const double boundY, RandomEngineAndDistribution const *) const
 
FastSingleTrackerRecHit smearMergeGroup (MergeGroup *mg, const PixelGeomDetUnit *detUnit, const double boundX, const double boundY, const RandomEngineAndDistribution *random) const
 
virtual ~PixelTemplateSmearerBase ()
 
- Public Member Functions inherited from TrackingRecHitAlgorithm
virtual void beginEvent (edm::Event &event, const edm::EventSetup &eventSetup)
 
virtual void beginStream (const edm::StreamID &id)
 
virtual void endEvent (edm::Event &event, const edm::EventSetup &eventSetup)
 
virtual void endStream ()
 
const TrackerGeometrygetMisalignedGeometry () const
 
const std::string & getName () const
 
const RandomEngineAndDistributiongetRandomEngine () const
 
const std::string & getSelectionString () const
 
const TrackerGeometrygetTrackerGeometry () const
 
const TrackerTopologygetTrackerTopology () const
 
 TrackingRecHitAlgorithm (const std::string &name, const edm::ParameterSet &config, edm::ConsumesCollector &consumesCollector)
 
virtual ~TrackingRecHitAlgorithm ()
 

Private Member Functions

void initializeForward ()
 

Additional Inherited Members

- Protected Member Functions inherited from PixelTemplateSmearerBase
bool isFlipped (const PixelGeomDetUnit *theDet) const
 
- Protected Attributes inherited from PixelTemplateSmearerBase
bool isForward
 
bool mergeHitsOn
 
double rescotAlpha_binMin
 
unsigned int rescotAlpha_binN
 
double rescotAlpha_binWidth
 
double rescotBeta_binMin
 
unsigned int rescotBeta_binN
 
double rescotBeta_binWidth
 
int resqbin_binMin
 
unsigned int resqbin_binN
 
int resqbin_binWidth
 
int templateId
 
std::unique_ptr< TFile > theBigPixelResolutionFile
 
std::string theBigPixelResolutionFileName
 
std::unique_ptr< TFile > theEdgePixelResolutionFile
 
std::string theEdgePixelResolutionFileName
 
unsigned int theLayer
 
std::unique_ptr< TFile > theMergedPixelResolutionXFile
 
std::string theMergedPixelResolutionXFileName
 
std::unique_ptr< TFile > theMergedPixelResolutionYFile
 
std::string theMergedPixelResolutionYFileName
 
std::unique_ptr< TFile > theMergingProbabilityFile
 
std::string theMergingProbabilityFileName
 
std::vector< SiPixelTemplateStorethePixelTemp_
 
std::unique_ptr< TFile > theRegularPixelResolutionFile
 
std::string theRegularPixelResolutionFileName
 
std::map< unsigned int, const SimpleHistogramGenerator * > theXHistos
 
std::map< unsigned int, const SimpleHistogramGenerator * > theYHistos
 

Detailed Description

Definition at line 45 of file PixelForwardTemplateSmearerPlugin.cc.

Constructor & Destructor Documentation

PixelForwardTemplateSmearerPlugin::PixelForwardTemplateSmearerPlugin ( const std::string &  name,
const edm::ParameterSet config,
edm::ConsumesCollector consumesCollector 
)
explicit

Definition at line 61 of file PixelForwardTemplateSmearerPlugin.cc.

References Exception, edm::FileInPath::fullPath(), edm::ParameterSet::getParameter(), initializeForward(), PixelTemplateSmearerBase::isForward, SiPixelTemplate::pushfile(), PixelTemplateSmearerBase::templateId, PixelTemplateSmearerBase::theBigPixelResolutionFile, PixelTemplateSmearerBase::theBigPixelResolutionFileName, PixelTemplateSmearerBase::theEdgePixelResolutionFile, PixelTemplateSmearerBase::theEdgePixelResolutionFileName, PixelTemplateSmearerBase::theMergedPixelResolutionXFile, PixelTemplateSmearerBase::theMergedPixelResolutionXFileName, PixelTemplateSmearerBase::theMergedPixelResolutionYFile, PixelTemplateSmearerBase::theMergedPixelResolutionYFileName, PixelTemplateSmearerBase::theMergingProbabilityFile, PixelTemplateSmearerBase::theMergingProbabilityFileName, PixelTemplateSmearerBase::thePixelTemp_, PixelTemplateSmearerBase::theRegularPixelResolutionFile, and PixelTemplateSmearerBase::theRegularPixelResolutionFileName.

65  :
66  PixelTemplateSmearerBase(name,config,consumesCollector)
67 {
68 
69  isForward = true;
70 
71  theEdgePixelResolutionFileName = config.getParameter<string>( "EdgePixelForwardResolutionFile" );
72  theEdgePixelResolutionFile = std::make_unique<TFile>( edm::FileInPath( theEdgePixelResolutionFileName ).fullPath().c_str() ,"READ");
73  theBigPixelResolutionFileName = config.getParameter<string>( "BigPixelForwardResolutionFile" );
74  theBigPixelResolutionFile = std::make_unique<TFile>( edm::FileInPath( theBigPixelResolutionFileName ).fullPath().c_str() ,"READ");
75  theRegularPixelResolutionFileName = config.getParameter<string>( "RegularPixelForwardResolutionFile" );
76  theRegularPixelResolutionFile = std::make_unique<TFile>( edm::FileInPath( theRegularPixelResolutionFileName ).fullPath().c_str() ,"READ");
77 
78  theMergingProbabilityFileName = config.getParameter<string>( "MergingProbabilityForwardFile" );
79  theMergingProbabilityFile =std::make_unique<TFile>( edm::FileInPath( theMergingProbabilityFileName ).fullPath().c_str() ,"READ");
80  theMergedPixelResolutionXFileName = config.getParameter<string>( "MergedPixelForwardResolutionXFile" );
81  theMergedPixelResolutionXFile = std::make_unique<TFile>( edm::FileInPath( theMergedPixelResolutionXFileName ).fullPath().c_str() ,"READ");
82  theMergedPixelResolutionYFileName = config.getParameter<string>( "MergedPixelForwardResolutionYFile" );
83  theMergedPixelResolutionYFile = std::make_unique<TFile>( edm::FileInPath( theMergedPixelResolutionYFileName ).fullPath().c_str() ,"READ");
84 
86 
87 
88 
90  {
91  throw cms::Exception("PixelForwardTemplateSmearerPlugin:") <<"SiPixel Forward Template Not Loaded Correctly!";
92  }
93 }
T getParameter(std::string const &) const
std::unique_ptr< TFile > theRegularPixelResolutionFile
std::unique_ptr< TFile > theEdgePixelResolutionFile
static bool pushfile(int filenum, std::vector< SiPixelTemplateStore > &thePixelTemp_)
std::unique_ptr< TFile > theMergingProbabilityFile
std::unique_ptr< TFile > theMergedPixelResolutionXFile
std::unique_ptr< TFile > theBigPixelResolutionFile
std::vector< SiPixelTemplateStore > thePixelTemp_
std::unique_ptr< TFile > theMergedPixelResolutionYFile
std::string fullPath() const
Definition: FileInPath.cc:184
PixelTemplateSmearerBase(const std::string &name, const edm::ParameterSet &config, edm::ConsumesCollector &consumesCollector)
PixelForwardTemplateSmearerPlugin::~PixelForwardTemplateSmearerPlugin ( )
virtual

Definition at line 96 of file PixelForwardTemplateSmearerPlugin.cc.

97 {
98 }

Member Function Documentation

void PixelForwardTemplateSmearerPlugin::initializeForward ( )
private

Definition at line 101 of file PixelForwardTemplateSmearerPlugin.cc.

References DEFINE_EDM_PLUGIN, PixelTemplateSmearerBase::rescotAlpha_binMin, PixelTemplateSmearerBase::rescotAlpha_binN, PixelTemplateSmearerBase::rescotAlpha_binWidth, PixelTemplateSmearerBase::rescotBeta_binMin, PixelTemplateSmearerBase::rescotBeta_binN, PixelTemplateSmearerBase::rescotBeta_binWidth, PixelTemplateSmearerBase::resqbin_binMin, PixelTemplateSmearerBase::resqbin_binN, PixelTemplateSmearerBase::resqbin_binWidth, PixelTemplateSmearerBase::theBigPixelResolutionFile, PixelTemplateSmearerBase::theEdgePixelResolutionFile, PixelTemplateSmearerBase::theRegularPixelResolutionFile, PixelTemplateSmearerBase::theXHistos, and PixelTemplateSmearerBase::theYHistos.

Referenced by PixelForwardTemplateSmearerPlugin().

102 {
103  rescotAlpha_binMin = 0.1;
104  rescotAlpha_binWidth = 0.1;
105  rescotAlpha_binN = 4;
106  rescotBeta_binMin = 0.;
107  rescotBeta_binWidth = 0.15;
108  rescotBeta_binN = 4;
109  resqbin_binMin = 0;
110  resqbin_binWidth = 1;
111  resqbin_binN = 4;
112 
113  // Initialize the forward histos once and for all, and prepare the random generation
114  for ( unsigned cotalphaHistBin=1; cotalphaHistBin<=rescotAlpha_binN; ++cotalphaHistBin)
115  {
116  for ( unsigned cotbetaHistBin=1; cotbetaHistBin<=rescotBeta_binN; ++cotbetaHistBin)
117  {
118  for( unsigned qbinBin=1; qbinBin<=resqbin_binN; ++qbinBin )
119  {
120  unsigned int edgePixelHistN = cotalphaHistBin*1000 + cotbetaHistBin*10 + qbinBin;
121  theXHistos[edgePixelHistN] = new SimpleHistogramGenerator((TH1F*)theEdgePixelResolutionFile->Get(Form("DQMData/clustFPIX/fhx0%u",edgePixelHistN)));
122  theYHistos[edgePixelHistN] = new SimpleHistogramGenerator((TH1F*)theEdgePixelResolutionFile->Get(Form("DQMData/clustFPIX/fhy0%u",edgePixelHistN)));
123 
124  unsigned int PixelHistN = 10000 + cotbetaHistBin*100 + cotalphaHistBin*10 + qbinBin;
125  theXHistos[PixelHistN] = new SimpleHistogramGenerator((TH1F*) theRegularPixelResolutionFile->Get(Form("hx0%u",PixelHistN)));
126  theYHistos[PixelHistN] = new SimpleHistogramGenerator((TH1F*) theRegularPixelResolutionFile->Get(Form("hy0%u",PixelHistN)));
127  }
128  }
129  }
130 
131  for ( unsigned cotalphaHistBin=1; cotalphaHistBin<=rescotAlpha_binN; ++cotalphaHistBin)
132  {
133  for ( unsigned cotbetaHistBin=1; cotbetaHistBin<=rescotBeta_binN; ++cotbetaHistBin)
134  {
135  unsigned int SingleBigPixelHistN = 100000 + cotalphaHistBin*100 + cotbetaHistBin;
136  theXHistos[SingleBigPixelHistN] = new SimpleHistogramGenerator((TH1F*)theBigPixelResolutionFile->Get(Form("DQMData/clustFPIX/fhx%u",SingleBigPixelHistN)));
137  theYHistos[SingleBigPixelHistN] = new SimpleHistogramGenerator((TH1F*)theBigPixelResolutionFile->Get(Form("DQMData/clustFPIX/fhy%u",SingleBigPixelHistN)));
138 
139  unsigned int SinglePixelHistN = cotbetaHistBin*10 + cotalphaHistBin;
140  theXHistos[SinglePixelHistN] = new SimpleHistogramGenerator((TH1F*)theRegularPixelResolutionFile->Get(Form("hx000%u",SinglePixelHistN)));
141  theYHistos[SinglePixelHistN] = new SimpleHistogramGenerator((TH1F*)theRegularPixelResolutionFile->Get(Form("hy000%u",SinglePixelHistN)));
142  }
143  }
144 }
std::unique_ptr< TFile > theRegularPixelResolutionFile
std::unique_ptr< TFile > theEdgePixelResolutionFile
std::map< unsigned int, const SimpleHistogramGenerator * > theYHistos
std::map< unsigned int, const SimpleHistogramGenerator * > theXHistos
std::unique_ptr< TFile > theBigPixelResolutionFile