CMS 3D CMS Logo

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

Public Member Functions

 PixelBarrelTemplateSmearerPlugin (const std::string &name, const edm::ParameterSet &config, edm::ConsumesCollector &consumesCollector)
 
 ~PixelBarrelTemplateSmearerPlugin () override
 
- 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)
 
TrackingRecHitProductPtr process (TrackingRecHitProductPtr product) const override
 
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
 
 ~PixelTemplateSmearerBase () override
 
- 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 initializeBarrel ()
 

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 29 of file PixelBarrelTemplateSmearerPlugin.cc.

Constructor & Destructor Documentation

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

Definition at line 45 of file PixelBarrelTemplateSmearerPlugin.cc.

References Exception, edm::FileInPath::fullPath(), edm::ParameterSet::getParameter(), initializeBarrel(), 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.

49  :
50  PixelTemplateSmearerBase(name,config,consumesCollector)
51 {
52  isForward = false;
53 
54  theBigPixelResolutionFileName = config.getParameter<string>( "BigPixelBarrelResolutionFile" );
55  theBigPixelResolutionFile = std::make_unique<TFile>( edm::FileInPath( theBigPixelResolutionFileName ).fullPath().c_str() ,"READ");
56  theEdgePixelResolutionFileName = config.getParameter<string>( "EdgePixelBarrelResolutionFile" );
57  theEdgePixelResolutionFile = std::make_unique<TFile>( edm::FileInPath( theEdgePixelResolutionFileName ).fullPath().c_str() ,"READ");
58  theRegularPixelResolutionFileName = config.getParameter<string>( "RegularPixelBarrelResolutionFile" );
59  theRegularPixelResolutionFile = std::make_unique<TFile>( edm::FileInPath( theRegularPixelResolutionFileName ).fullPath().c_str() ,"READ");
60 
61  theMergingProbabilityFileName = config.getParameter<string>( "MergingProbabilityBarrelFile" );
62  theMergingProbabilityFile = std::make_unique<TFile>( edm::FileInPath( theMergingProbabilityFileName ).fullPath().c_str() ,"READ");
63  theMergedPixelResolutionXFileName = config.getParameter<string>( "MergedPixelBarrelResolutionXFile" );
64  theMergedPixelResolutionXFile = std::make_unique<TFile>( edm::FileInPath( theMergedPixelResolutionXFileName ).fullPath().c_str() ,"READ");
65  theMergedPixelResolutionYFileName = config.getParameter<string>( "MergedPixelBarrelResolutionYFile" );
66  theMergedPixelResolutionYFile = std::make_unique<TFile>( edm::FileInPath( theMergedPixelResolutionYFileName ).fullPath().c_str() ,"READ");
67 
69 
71  {
72  throw cms::Exception("PixelBarrelTemplateSmearerPlugin:")<<"SiPixel Barrel Template Not Loaded Correctly!"<<endl;
73  }
74 
75 }
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:197
PixelTemplateSmearerBase(const std::string &name, const edm::ParameterSet &config, edm::ConsumesCollector &consumesCollector)
PixelBarrelTemplateSmearerPlugin::~PixelBarrelTemplateSmearerPlugin ( )
override

Definition at line 78 of file PixelBarrelTemplateSmearerPlugin.cc.

79 {
80 }

Member Function Documentation

void PixelBarrelTemplateSmearerPlugin::initializeBarrel ( )
private

Definition at line 83 of file PixelBarrelTemplateSmearerPlugin.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 PixelBarrelTemplateSmearerPlugin().

84 {
85  rescotAlpha_binMin = -0.2;
86  rescotAlpha_binWidth = 0.08 ;
87  rescotAlpha_binN = 5;
88  rescotBeta_binMin = -5.5;
89  rescotBeta_binWidth = 1.0;
90  rescotBeta_binN = 11;
91  resqbin_binMin = 0;
92  resqbin_binWidth = 1;
93  resqbin_binN = 4;
94 
95  for (unsigned cotalphaHistBin=1; cotalphaHistBin<=rescotAlpha_binN; ++cotalphaHistBin)
96  {
97  for (unsigned cotbetaHistBin=1; cotbetaHistBin<=rescotBeta_binN; ++cotbetaHistBin)
98  {
99  unsigned int singleBigPixelHistN = 1*100000 + cotalphaHistBin*100 + cotbetaHistBin;
100  theXHistos[singleBigPixelHistN] = new SimpleHistogramGenerator((TH1F*)theBigPixelResolutionFile->Get(Form("DQMData/clustBPIX/hx%u",singleBigPixelHistN)));
101  theYHistos[singleBigPixelHistN] = new SimpleHistogramGenerator((TH1F*)theBigPixelResolutionFile->Get(Form("DQMData/clustBPIX/hy%u",singleBigPixelHistN)));
102 
103  unsigned int singlePixelHistN = 1*10000 + cotbetaHistBin*10 + cotalphaHistBin;
104  theXHistos[singlePixelHistN] = new SimpleHistogramGenerator((TH1F*)theRegularPixelResolutionFile->Get(Form("hx%u",singlePixelHistN)));
105  theYHistos[singlePixelHistN] = new SimpleHistogramGenerator((TH1F*)theRegularPixelResolutionFile->Get(Form("hy%u",singlePixelHistN)));
106 
107  for(unsigned qbinBin=1; qbinBin<=resqbin_binN; ++qbinBin )
108  {
109  unsigned int edgePixelHistN = cotalphaHistBin*1000 + cotbetaHistBin*10 + qbinBin;
110  theXHistos[edgePixelHistN] = new SimpleHistogramGenerator((TH1F*)theEdgePixelResolutionFile->Get(Form("DQMData/clustBPIX/hx0%u",edgePixelHistN)));
111  theYHistos[edgePixelHistN] = new SimpleHistogramGenerator((TH1F*)theEdgePixelResolutionFile->Get(Form("DQMData/clustBPIX/hy0%u",edgePixelHistN)));
112 
113  unsigned int multiPixelBigHistN = 1*1000000 + 1*100000 + cotalphaHistBin*1000 + cotbetaHistBin * 10 + qbinBin;
114  theXHistos[multiPixelBigHistN] = new SimpleHistogramGenerator((TH1F*)theBigPixelResolutionFile->Get(Form("DQMData/clustBPIX/hx%u",multiPixelBigHistN)));
115  theYHistos[multiPixelBigHistN] = new SimpleHistogramGenerator((TH1F*)theBigPixelResolutionFile->Get(Form("DQMData/clustBPIX/hy%u",multiPixelBigHistN)));
116 
117  unsigned int multiPixelHistN = 1*100000 + 1*10000 + cotbetaHistBin*100 + cotalphaHistBin*10 + qbinBin;
118  theXHistos[multiPixelHistN] = new SimpleHistogramGenerator((TH1F*)theRegularPixelResolutionFile->Get(Form("hx%u",multiPixelHistN)));
119  theYHistos[multiPixelHistN] = new SimpleHistogramGenerator((TH1F*)theRegularPixelResolutionFile->Get(Form("hy%u",multiPixelHistN)));
120  }
121  }
122  }
123 }
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