17 : fName(
""),
verbosity(0), frequency(0), vtxunit(0),
21 std::string MsgLoggerCat =
22 "GlobalHitsProdHistStripper_GlobalHitsProdHistStripper";
34 m_Prov.getUntrackedParameter<
bool>(
"GetAllProvenances");
36 m_Prov.getUntrackedParameter<
bool>(
"PrintProvenanceInfo");
61 <<
"\n===============================\n"
62 <<
"Initialized as EDAnalyzer with parameter values:\n"
63 <<
" Name = " <<
fName <<
"\n"
64 <<
" Verbosity = " << verbosity <<
"\n"
65 <<
" Frequency = " << frequency <<
"\n"
66 <<
" VtxUnit = " << vtxunit <<
"\n"
67 <<
" OutputFile = " << outputfile <<
"\n"
68 <<
" DoOutput = " << doOutput <<
"\n"
69 <<
" GetProv = " << getAllProvenances <<
"\n"
70 <<
" PrintProv = " << printProvenanceInfo <<
"\n"
71 <<
"===============================\n";
89 std::string MsgLoggerCat =
"GlobalHitsProdHistStripper_endJob";
92 <<
"Terminating having processed " <<
count <<
" runs.";
99 std::string MsgLoggerCat =
"GlobalHitsProdHistStripper_beginRun";
103 int nrun = iRun.
run();
107 <<
"Processing run " << nrun <<
" (" <<
count <<
" runs total)";
111 <<
"Processing run " << nrun <<
" (" <<
count <<
" runs total)";
117 std::vector<const edm::Provenance*> AllProv;
122 <<
"Number of Provenances = " << AllProv.size();
125 TString eventout(
"\nProvenance info:\n");
127 for (
unsigned int i = 0;
i < AllProv.size(); ++
i) {
128 eventout +=
"\n ******************************";
129 eventout +=
"\n Module : ";
130 eventout += AllProv[
i]->moduleLabel();
131 eventout +=
"\n ProductID : ";
132 eventout += AllProv[
i]->productID().id();
133 eventout +=
"\n ClassName : ";
134 eventout += AllProv[
i]->className();
135 eventout +=
"\n InstanceName : ";
136 eventout += AllProv[
i]->productInstanceName();
137 eventout +=
"\n BranchName : ";
138 eventout += AllProv[
i]->branchName();
140 eventout +=
"\n ******************************\n";
153 std::string MsgLoggerCat =
"GlobalHitsProdHistStripper_endRun";
156 std::vector<edm::Handle<TH1F> > allhistogram1D;
159 me.resize(allhistogram1D.size());
161 for (uint
i = 0;
i < allhistogram1D.size(); ++
i) {
162 histogram1D = allhistogram1D[
i];
165 <<
"Invalid histogram extracted from event.";
190 if ((histogram1D.
provenance()->product()).moduleLabel()
191 !=
"globalhitsprodhist")
continue;
193 std::string histname = histogram1D->GetName();
195 std::string subhist1 = histname.substr(1,5);
196 std::string subhist2 = histname.substr(1,4);
199 if (subhist1 ==
"CaloE" || subhist1 ==
"CaloP") {
201 }
else if (subhist1 ==
"CaloH") {
203 }
else if (subhist1 ==
"Geant" || subhist2 ==
"MCG4" ||
204 subhist1 ==
"MCRGP") {
206 }
else if (subhist2 ==
"Muon") {
208 }
else if (subhist1 ==
"Track") {
213 histogram1D->GetXaxis()->GetNbins(),
214 histogram1D->GetXaxis()->GetXmin(),
215 histogram1D->GetXaxis()->GetXmax());
216 me[
i]->setAxisTitle(histogram1D->GetXaxis()->GetTitle(),1);
217 me[
i]->setAxisTitle(histogram1D->GetYaxis()->GetTitle(),2);
221 std::string mename =
me[
i]->getName();
227 for (Int_t
x = 1;
x <= histogram1D->GetXaxis()->GetNbins(); ++
x) {
228 Double_t binx = histogram1D->GetBinCenter(
x);
229 Double_t
value = histogram1D->GetBinContent(
x);
230 me[
i]->Fill(binx,value);
virtual void beginRun(const edm::Run &, const edm::EventSetup &)
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
virtual ~GlobalHitsProdHistStripper()
void getAllProvenance(std::vector< Provenance const * > &provenances) const
void save(const std::string &filename, const std::string &path="", const std::string &pattern="", const std::string &rewrite="", SaveReferenceTag ref=SaveWithReference, int minStatus=dqm::qstatus::STATUS_OK, const std::string &fileupdate="RECREATE")
virtual void endRun(const edm::Run &, const edm::EventSetup &)
GlobalHitsProdHistStripper(const edm::ParameterSet &)
void setVerbose(unsigned level)
virtual void beginJob(void)
void getManyByType(std::vector< Handle< PROD > > &results) const
std::vector< MonitorElement * > me
virtual void analyze(const edm::Event &, const edm::EventSetup &)
void showDirStructure(void) const
void setCurrentFolder(const std::string &fullpath)
Provenance const * provenance() const