Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fastsim pixel res histo update #10555

Merged
merged 4 commits into from Aug 7, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -94,6 +94,8 @@ class SiPixelGaussianSmearingRecHitConverterAlgorithm {
//Splite the resolution histograms for cvs uploading
TFile* thePixelResolutionFile2;
std::string thePixelResolutionFileName2;
TFile* thePixelResolutionFile3;
std::string thePixelResolutionFileName3;

unsigned int theLayer;
// output
Expand Down
Expand Up @@ -76,6 +76,8 @@
NewPixelForwardResolutionFile = cms.string('FastSimulation/TrackingRecHitProducer/data/NewPixelResolutionForward38T.root'),
NewPixelBarrelResolutionFile1 = cms.string('FastSimulation/TrackingRecHitProducer/data/NewPixelResolutionBarrel38T.root'),
NewPixelBarrelResolutionFile2 = cms.string('FastSimulation/TrackingRecHitProducer/data/NewPixelResolutionBarrelEdge38T.root'),
NewPixelForwardResolutionFile2 = cms.string('FastSimulation/TrackingRecHitProducer/data/PixelForwardResolution2014.root'),
NewPixelBarrelResolutionFile3 = cms.string('FastSimulation/TrackingRecHitProducer/data/PixelBarrelResolution2014.root'),

UseNewParametrization = cms.bool(True),

Expand Down
Expand Up @@ -58,6 +58,10 @@ SiPixelGaussianSmearingRecHitConverterAlgorithm::SiPixelGaussianSmearingRecHitCo
thePixelResolutionFileName2 = pset_.getParameter<string>( "NewPixelBarrelResolutionFile2" );
thePixelResolutionFile2 = new
TFile( edm::FileInPath( thePixelResolutionFileName2 ).fullPath().c_str() ,"READ");
//ALICE
thePixelResolutionFileName3 = pset_.getParameter<string>( "NewPixelBarrelResolutionFile3" );
thePixelResolutionFile3 = new
TFile( edm::FileInPath( thePixelResolutionFileName3 ).fullPath().c_str() ,"READ");
initializeBarrel();
tempId = pset_.getParameter<int> ( "templateIdBarrel" );
if( ! SiPixelTemplate::pushfile(tempId, thePixelTemp_) )
Expand All @@ -73,6 +77,10 @@ SiPixelGaussianSmearingRecHitConverterAlgorithm::SiPixelGaussianSmearingRecHitCo
thePixelResolutionFileName1 = pset_.getParameter<string>( "NewPixelForwardResolutionFile" );
thePixelResolutionFile1 = new
TFile( edm::FileInPath( thePixelResolutionFileName1 ).fullPath().c_str() ,"READ");
//ALICE
thePixelResolutionFileName2 = pset_.getParameter<string>( "NewPixelForwardResolutionFile2" );
thePixelResolutionFile2 = new
TFile( edm::FileInPath( thePixelResolutionFileName2 ).fullPath().c_str() ,"READ");
initializeForward();
tempId = pset_.getParameter<int> ( "templateIdForward" );
if( ! SiPixelTemplate::pushfile(tempId, thePixelTemp_) )
Expand Down Expand Up @@ -382,6 +390,7 @@ void SiPixelGaussianSmearingRecHitConverterAlgorithm::smearHit(
//
unsigned int theXHistN;
unsigned int theYHistN;
//ALICE
if( !isForward ) {
if(edge)
{
Expand All @@ -393,22 +402,27 @@ void SiPixelGaussianSmearingRecHitConverterAlgorithm::smearHit(
if(singlex)
{
if(hitbigx) theXHistN = 1 * 100000 + cotalphaHistBin * 100 + cotbetaHistBin ;
else theXHistN = 1 * 100000 + 1 * 1000 + cotalphaHistBin * 100 + cotbetaHistBin ;
else theXHistN = 1 * 10000 + cotbetaHistBin * 10 + cotalphaHistBin ;
//else theXHistN = 1 * 100000 + 1 * 1000 + cotalphaHistBin * 100 + cotbetaHistBin ;
}
else
{
if(hasBigPixelInX) theXHistN = 1 * 1000000 + 1 * 100000 + cotalphaHistBin * 1000 + cotbetaHistBin * 10 + (nqbin+1);
else theXHistN = 1 * 1000000 + 1 * 100000 + 1 * 10000 + cotalphaHistBin * 1000 + cotbetaHistBin * 10 + (nqbin+1);
else theXHistN = 1 * 100000 + 1 * 10000 + cotbetaHistBin * 100 + cotalphaHistBin * 10 + (nqbin+1);
//else theXHistN = 1 * 1000000 + 1 * 100000 + 1 * 10000 + cotalphaHistBin * 1000 + cotbetaHistBin * 10 + (nqbin+1);
}
if(singley)
{
if(hitbigy) theYHistN = 1 * 100000 + cotalphaHistBin * 100 + cotbetaHistBin ;
else theYHistN = 1 * 100000 + 1 * 1000 + cotalphaHistBin * 100 + cotbetaHistBin ;
else theYHistN = 1 * 10000 + cotbetaHistBin * 10 + cotalphaHistBin ;
// else theYHistN = 1 * 100000 + 1 * 1000 + cotalphaHistBin * 100 + cotbetaHistBin ;
}
else
{
if(hasBigPixelInY) theYHistN = 1 * 1000000 + 1 * 100000 + cotalphaHistBin * 1000 + cotbetaHistBin * 10 + (nqbin+1);
else theYHistN = 1 * 1000000 + 1 * 100000 + 1 * 10000 + cotalphaHistBin * 1000 + cotbetaHistBin * 10 + (nqbin+1);
// else theYHistN = 1 * 1000000 + 1 * 100000 + 1 * 10000 + cotalphaHistBin * 1000 + cotbetaHistBin * 10 + (nqbin+1);
else theYHistN = 1 * 100000 + 1 * 10000 + cotbetaHistBin * 100 + cotalphaHistBin * 10 + (nqbin+1);

}
}
}
Expand All @@ -424,17 +438,25 @@ void SiPixelGaussianSmearingRecHitConverterAlgorithm::smearHit(
if( singlex )
if( hitbigx )
theXHistN = 100000 + cotalphaHistBin * 100 + cotbetaHistBin;
else
theXHistN = 100000 + 1000 + cotalphaHistBin * 100 + cotbetaHistBin;
else
theXHistN = 100000 + 10000 + cotalphaHistBin * 1000 + cotbetaHistBin * 10 + (nqbin+1);
else{
theXHistN = cotbetaHistBin * 10 + cotalphaHistBin;
// theXHistN = 100000 + 1000 + cotalphaHistBin * 100 + cotbetaHistBin;
}
else{
theXHistN = 10000 + cotbetaHistBin * 100 + cotalphaHistBin * 10 + (nqbin+1);
// theXHistN = 100000 + 10000 + cotalphaHistBin * 1000 + cotbetaHistBin * 10 + (nqbin+1);
}
if( singley )
if( hitbigy )
theYHistN = 100000 + cotalphaHistBin * 100 + cotbetaHistBin;
else
theYHistN = 100000 + 1000 + cotalphaHistBin * 100 + cotbetaHistBin;
else
theYHistN = 100000 + 10000 + cotalphaHistBin * 1000 + cotbetaHistBin * 10 + (nqbin+1);
else{
theYHistN = cotbetaHistBin * 10 + cotalphaHistBin;
// theYHistN = 100000 + 1000 + cotalphaHistBin * 100 + cotbetaHistBin;
}
else{
theYHistN = 10000 + cotbetaHistBin * 100 + cotalphaHistBin * 10 + (nqbin+1);
//theYHistN = 100000 + 10000 + cotalphaHistBin * 1000 + cotbetaHistBin * 10 + (nqbin+1);
}
}
}
unsigned int counter = 0;
Expand Down Expand Up @@ -518,13 +540,21 @@ void SiPixelGaussianSmearingRecHitConverterAlgorithm::initializeBarrel()
(TH1F*) thePixelResolutionFile1->Get( Form( "DQMData/clustBPIX/hx%u" , singleBigPixelHistN ) ) );
theYHistos[singleBigPixelHistN] = new SimpleHistogramGenerator(
(TH1F*) thePixelResolutionFile1->Get( Form( "DQMData/clustBPIX/hy%u" , singleBigPixelHistN ) ) );
unsigned int singlePixelHistN = 1 * 100000 + 1 * 1000
/* unsigned int singlePixelHistN = 1 * 100000 + 1 * 1000
+ cotalphaHistBin * 100
+ cotbetaHistBin ;
theXHistos[singlePixelHistN] = new SimpleHistogramGenerator(
(TH1F*) thePixelResolutionFile1->Get( Form( "DQMData/clustBPIX/hx%u" , singlePixelHistN ) ) );
theYHistos[singlePixelHistN] = new SimpleHistogramGenerator(
(TH1F*) thePixelResolutionFile1->Get( Form( "DQMData/clustBPIX/hy%u" , singlePixelHistN ) ) );
(TH1F*) thePixelResolutionFile1->Get( Form( "DQMData/clustBPIX/hy%u" , singlePixelHistN ) ) );*/
unsigned int singlePixelHistN = 1 * 10000
+ cotbetaHistBin * 10
+ cotalphaHistBin ;
theXHistos[singlePixelHistN] = new SimpleHistogramGenerator(
(TH1F*) thePixelResolutionFile3->Get( Form( "hx%u" , singlePixelHistN ) ) );
theYHistos[singlePixelHistN] = new SimpleHistogramGenerator(
(TH1F*) thePixelResolutionFile3->Get( Form( "hy%u" , singlePixelHistN ) ) );

for( unsigned qbinBin=1; qbinBin<=resqbin_binN; ++qbinBin ) {
unsigned int edgePixelHistN = cotalphaHistBin * 1000
+ cotbetaHistBin * 10
Expand All @@ -541,14 +571,22 @@ void SiPixelGaussianSmearingRecHitConverterAlgorithm::initializeBarrel()
(TH1F*) thePixelResolutionFile1->Get( Form( "DQMData/clustBPIX/hx%u" ,multiPixelBigHistN ) ) );
theYHistos[multiPixelBigHistN] = new SimpleHistogramGenerator(
(TH1F*) thePixelResolutionFile1->Get( Form( "DQMData/clustBPIX/hy%u" ,multiPixelBigHistN ) ) );
unsigned int multiPixelHistN = 1 * 1000000 + 1 * 100000 + 1 * 10000
/* unsigned int multiPixelHistN = 1 * 1000000 + 1 * 100000 + 1 * 10000
+ cotalphaHistBin * 1000
+ cotbetaHistBin * 10
+ qbinBin;
theXHistos[multiPixelHistN] = new SimpleHistogramGenerator(
(TH1F*) thePixelResolutionFile1->Get( Form( "DQMData/clustBPIX/hx%u" , multiPixelHistN ) ) );
theYHistos[multiPixelHistN] = new SimpleHistogramGenerator(
(TH1F*) thePixelResolutionFile1->Get( Form( "DQMData/clustBPIX/hy%u" , multiPixelHistN ) ) );
(TH1F*) thePixelResolutionFile1->Get( Form( "DQMData/clustBPIX/hy%u" , multiPixelHistN ) ) );*/
unsigned int multiPixelHistN = 1 * 100000 + 1 * 10000
+ cotbetaHistBin * 100
+ cotalphaHistBin * 10
+ qbinBin;
theXHistos[multiPixelHistN] = new SimpleHistogramGenerator(
(TH1F*) thePixelResolutionFile3->Get( Form( "hx%u" , multiPixelHistN ) ) );
theYHistos[multiPixelHistN] = new SimpleHistogramGenerator(
(TH1F*) thePixelResolutionFile3->Get( Form( "hy%u" , multiPixelHistN ) ) );
} //end for qbinBin
}//end for cotalphaHistBin, cotbetaHistBin
}
Expand All @@ -575,11 +613,17 @@ void SiPixelGaussianSmearingRecHitConverterAlgorithm::initializeForward()
(TH1F*) thePixelResolutionFile1->Get( Form( "DQMData/clustFPIX/fhx0%u" ,edgePixelHistN ) ) );
theYHistos[edgePixelHistN] = new SimpleHistogramGenerator(
(TH1F*) thePixelResolutionFile1->Get( Form( "DQMData/clustFPIX/fhy0%u" ,edgePixelHistN ) ) );
unsigned int PixelHistN = 100000 + 10000 + cotalphaHistBin * 1000 + cotbetaHistBin * 10 + qbinBin;
/* unsigned int PixelHistN = 100000 + 10000 + cotalphaHistBin * 1000 + cotbetaHistBin * 10 + qbinBin;
theXHistos[PixelHistN] = new SimpleHistogramGenerator(
(TH1F*) thePixelResolutionFile1->Get( Form( "DQMData/clustFPIX/fhx%u" ,PixelHistN ) ) );
theYHistos[PixelHistN] = new SimpleHistogramGenerator(
(TH1F*) thePixelResolutionFile1->Get( Form( "DQMData/clustFPIX/fhy%u" ,PixelHistN ) ) );
(TH1F*) thePixelResolutionFile1->Get( Form( "DQMData/clustFPIX/fhy%u" ,PixelHistN ) ) );*/
unsigned int PixelHistN = 10000 + cotbetaHistBin * 100 + cotalphaHistBin * 10 + qbinBin;
theXHistos[PixelHistN] = new SimpleHistogramGenerator(
(TH1F*) thePixelResolutionFile2->Get( Form( "hx0%u" ,PixelHistN ) ) );
theYHistos[PixelHistN] = new SimpleHistogramGenerator(
(TH1F*) thePixelResolutionFile2->Get( Form( "hy0%u" ,PixelHistN ) ) );

}//end cotalphaHistBin, cotbetaHistBin, qbinBin

for ( unsigned cotalphaHistBin=1; cotalphaHistBin<=rescotAlpha_binN; ++cotalphaHistBin )
Expand All @@ -590,11 +634,16 @@ void SiPixelGaussianSmearingRecHitConverterAlgorithm::initializeForward()
(TH1F*) thePixelResolutionFile1->Get( Form( "DQMData/clustFPIX/fhx%u" ,SingleBigPixelHistN ) ) );
theYHistos[SingleBigPixelHistN] = new SimpleHistogramGenerator(
(TH1F*) thePixelResolutionFile1->Get( Form( "DQMData/clustFPIX/fhy%u" ,SingleBigPixelHistN ) ) );
unsigned int SinglePixelHistN = 100000 + 1000 + cotalphaHistBin * 100 + cotbetaHistBin;
/* unsigned int SinglePixelHistN = 100000 + 1000 + cotalphaHistBin * 100 + cotbetaHistBin;
theXHistos[SinglePixelHistN] = new SimpleHistogramGenerator(
(TH1F*) thePixelResolutionFile1->Get( Form( "DQMData/clustFPIX/fhx%u" ,SinglePixelHistN ) ) );
theYHistos[SinglePixelHistN] = new SimpleHistogramGenerator(
(TH1F*) thePixelResolutionFile1->Get( Form( "DQMData/clustFPIX/fhy%u" ,SinglePixelHistN ) ) );
(TH1F*) thePixelResolutionFile1->Get( Form( "DQMData/clustFPIX/fhy%u" ,SinglePixelHistN ) ) );*/
unsigned int SinglePixelHistN = cotbetaHistBin * 10 + cotalphaHistBin;
theXHistos[SinglePixelHistN] = new SimpleHistogramGenerator(
(TH1F*) thePixelResolutionFile2->Get( Form( "hx000%u" ,SinglePixelHistN ) ) );
theYHistos[SinglePixelHistN] = new SimpleHistogramGenerator(
(TH1F*) thePixelResolutionFile2->Get( Form( "hy000%u" ,SinglePixelHistN ) ) );

}
}