119 modules_ = class_ -> GetUserModules();
128 ProvInfoPixels_vars =
"";
130 std::string ProvString =
"";
131 std::string VarString =
"";
138 cout <<
"From provenance infomation the selected strip modules are = "<< ProvInfo << endl;
139 ProvInfo_vars = pSet.
getParameter<
string>(
"stripVariables");
140 cout <<
"From provenance infomation the avaliable strip variables are = "<< ProvInfo_vars << endl;
144 ProvInfoPixels = pSet.
getParameter<
string>(
"pixelModule");
145 cout <<
"From provenance infomation the selected pixel modules are = "<< ProvInfoPixels << endl;
146 ProvInfoPixels_vars = pSet.
getParameter<
string>(
"pixelVariables");
147 cout <<
"From provenance infomation the avaliable pixel variables are = "<< ProvInfoPixels_vars << endl;
152 ProvString = ProvInfo +
"," + ProvInfoPixels;
153 VarString = ProvInfo_vars +
"," + ProvInfoPixels_vars;
156 ProvString = ProvInfo;
157 VarString = ProvInfo_vars;
160 ProvString = ProvInfoPixels;
161 VarString = ProvInfoPixels_vars;
165 v_moduleTypes = class_ -> DecodeProvInfo( ProvString );
166 v_variables = class_ -> DecodeProvInfo( VarString );
170 class_ -> SetUserContent( v_variables );
172 genericVariables_ = class_ -> GetGenericVariable();
180 for ( vector<int>::const_iterator
mod = modules_ .
begin();
mod != modules_ .
end();
mod++ ){
183 cout <<
"Creating histograms for " << v_moduleTypes.at(n) << endl;
185 std::string tmpstr = v_moduleTypes.at(n);
187 histos1D_[ (tmpstr +
"nclusters").c_str() ] = fs->make< TH1D >( (tmpstr +
"nclusters").c_str() , (tmpstr +
"nclusters").c_str() , 1000 , 0 , 3000 );
188 histos1D_[ (tmpstr +
"nclusters").c_str() ]->SetXTitle( (
"number of Clusters in " + tmpstr).c_str() );
190 histos1D_[ (tmpstr +
"avgCharge").c_str() ] = fs->make< TH1D >( (tmpstr +
"avgCharge").c_str() , (tmpstr +
"avgCharge").c_str() , 500 , 0 , 1000 );
191 histos1D_[ (tmpstr +
"avgCharge").c_str() ]->SetXTitle( (
"average cluster charge in " + tmpstr).c_str() );
193 histos1D_[ (tmpstr +
"avgSize").c_str() ] = fs->make< TH1D >( (tmpstr +
"avgSize").c_str() , (tmpstr +
"avgSize").c_str() , 30 , 0 , 10 );
194 histos1D_[ (tmpstr +
"avgSize").c_str() ]->SetXTitle( (
"average cluster size in " + tmpstr).c_str() );
196 maps.push_back( (tmpstr +
"nclusters").c_str() );
197 maps.push_back( (tmpstr +
"avgSize").c_str() );
198 maps.push_back( (tmpstr +
"avgCharge").c_str() );
209 for ( vector<int>::const_iterator
mod = modules_ .
begin();
mod != modules_ .
end();
mod++ ){
211 std::string tmpstr = v_moduleTypes.at(
n);
215 while (mod_tmp > 9 ){
221 histos1D_[ (tmpstr +
"nclusters").c_str() ] ->
Fill( class_ -> GetGenericVariable(
"cHits", *
mod) );
222 histos1D_[ (tmpstr +
"avgSize").c_str() ] ->
Fill( class_ -> GetGenericVariable(
"cSize", *
mod) /class_ -> GetGenericVariable(
"cHits", *
mod) );
223 histos1D_[ (tmpstr +
"avgCharge").c_str() ] ->
Fill( class_ -> GetGenericVariable(
"cCharge", *
mod)/class_ -> GetGenericVariable(
"cHits", *
mod) );
225 cout <<
"n"<<tmpstr <<
", avg size, avg charge = "<< class_ -> GetGenericVariable(
"cHits",*
mod );
226 cout <<
", "<< class_ -> GetGenericVariable(
"cSize",*
mod ) /class_ -> GetGenericVariable(
"cHits",*
mod );
227 cout <<
", "<< class_ -> GetGenericVariable(
"cCharge",*
mod )/class_ -> GetGenericVariable(
"cHits",*
mod ) << endl;
231 histos1D_[ (tmpstr +
"nclusters").c_str() ] ->
Fill( class_ -> GetGenericVariable(
"pHits", *
mod) );
232 histos1D_[ (tmpstr +
"avgSize").c_str() ] ->
Fill( class_ -> GetGenericVariable(
"pSize", *
mod)/class_ -> GetGenericVariable(
"pHits", *
mod) );
233 histos1D_[ (tmpstr +
"avgCharge").c_str() ] ->
Fill( class_ -> GetGenericVariable(
"pCharge", *
mod)/class_ -> GetGenericVariable(
"pHits", *
mod) );
235 cout <<
"n"<<tmpstr <<
", avg size, avg charge = "<< class_ -> GetGenericVariable(
"pHits",*
mod );
236 cout <<
", "<< class_ -> GetGenericVariable(
"pSize",*
mod ) /class_ -> GetGenericVariable(
"pHits",*
mod );
237 cout <<
", "<< class_ -> GetGenericVariable(
"pCharge",*
mod )/class_ -> GetGenericVariable(
"pHits",*
mod ) << endl;
245 cout <<
"-------------------------------------------------------" << endl;
T getParameter(std::string const &) const
virtual void analyze(const edm::Event &, const edm::EventSetup &)
std::string ProvInfoPixels_vars
std::string ProvInfo_vars
#define DEFINE_FWK_MODULE(type)
ParameterSet const & getParameterSet(ParameterSetID const &id)
std::vector< string > maps
std::map< int, std::string > enumModules_
ParameterSetID psetID() const
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
void clear(CLHEP::HepGenMatrix &m)
Helper function: Reset all elements of a matrix to 0.
std::vector< int > modules_
list mod
Load physics model.
std::vector< double > clusterCharge_
edm::Service< TFileService > fs
std::vector< std::string > v_moduleTypes
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
std::vector< std::string > v_variables
ClusterAnalyzer(const edm::ParameterSet &)
std::vector< std::vector< double > > genericVariables_
std::map< std::string, TH1D * > histos1D_
std::vector< int > nType_
std::string ProvInfoPixels
std::vector< double > clusterSize_
Provenance getProvenance(BranchID const &theID) const