compile does not recognize root histogram type TH1I
I am trying to create a model to use for analysis. I first build in normal mode and then in expert mode. It seems to compile fine before I edit the model .cpp and .h files.
~]$ cd madanalysis5/bin/
bin]$ ./ma5
bin]$ ./ma5 -R -E
bin]$ cd HAHM_LJmod/Build/
Build]$ source setup.sh
-------
Your environment is properly configured for MA5
-------
Build]$ make
-------
-------
-------
-------
g++ -Wall -O3 -fPIC -I/afs/
g++ -Wall -O3 -fPIC -I/afs/
-------
-------
g++ Main/main.o SampleAnalyzer/
At this point I change the HAHM_LJmod.cpp and HAHM_LJmod.h files. I copy them from a colleague's area. He had no trouble with using them. Then I recompile:
Build]$ source setup.sh
-------
Your environment is properly configured for MA5
-------
Build]$ make
-------
-------
-------
-------
g++ -Wall -O3 -fPIC -I/afs/
In file included from ./SampleAnalyze
./SampleAnalyze
TH1I* H0_;
^
make: *** [Main/main.o] Error 1
With this error the MadAnalysis5job does not run properly. Below are the .cpp and .h files before mentioned. Again, a colleague of mine uses these exact files and does not have a problem with it.
HAHM_LJmod.cpp:
#include "SampleAnalyzer
using namespace MA5;
using namespace std;
// -------
// Initialize
// function called one time at the beginning of the analysis
// -------
bool HAHM_LJmod:
{
cout << "BEGIN Initialization" << endl;
// initialize variables, histos
// Initializing PhysicsService for MC
PHYSICS-
// definition of the multiparticle "hadronic"
PHYSICS-
PHYSICS-
PHYSICS-
PHYSICS-
PHYSICS-
PHYSICS-
PHYSICS-
PHYSICS-
PHYSICS-
PHYSICS-
PHYSICS-
// definition of the multiparticle "invisible"
PHYSICS-
PHYSICS-
PHYSICS-
PHYSICS-
PHYSICS-
PHYSICS-
PHYSICS-
// Initializing each selection item
H0_= new TH1I("myhist", "Counts"
//counters
muonN2=0.0;
pionN2=0.0;
elecN2=0.0;
zdN=0;
muonN=0;
pionN=0;
elecN=0;
cout << "END Initialization" << endl;
return true;
}
// -------
// Finalize
// function called one time at the end of the analysis
// -------
void HAHM_LJmod:
{
cout << "BEGIN Finalization" << endl;
//make histogram file
TCanvas* myCanvas = new TCanvas(
H0_->Draw();
H0_->
myCanvas-
//print pranching ratios
INFO <<"Number of electrons " << elecN << " Branching ratio " << (float) elecN/(
INFO <<"Number of muons " << muonN << " Branching ratio " << (float) muonN/(
INFO <<"Number of pions " << pionN << " Branching ratio " << (float) pionN/(
INFO <<"Raw zd Number " << zdN <<endmsg;
vel=vel/zdN;
//float ct=4700*
float ct=47/vel;
INFO << "v/c " << vel <<" => ct="<< ct <<endmsg;
cout << "END Finalization" << endl;
}
// -------
// Execute
// function called each time one event is read
// -------
bool HAHM_LJmod:
{
//My actual work
unsigned int n=event.
for (unsigned int i=0; i<n ;i++) //loop over particles
{
const MCParticleFormat* prt = &event.
//this only for final state particle
/*
if(PHYSICS-
{
//if particle add to count and histogram
if(
if(
if(
// if(std:
// if(std:
// if(std:
}
*/
if(prt-
{
zdN+=1;
vel+
//two daughters
d1 = prt->daughters(
d2 = prt->daughters(
//update backup count
if(
if(
if(
if(
if(
if(
}
}
return true;
}
HAHM_LJmod.h:
#ifndef analysis_
#define analysis_
#include "SampleAnalyzer
namespace MA5
{
class HAHM_LJmod : public AnalyzerBase
{
INIT_
public:
virtual bool Initialize(const MA5::Configuration& cfg, const std::map<
virtual void Finalize(const SampleFormat& summary, const std::vector<
virtual bool Execute(
private:
// Declaring histogram array
PlotManager plots_;
// Declaring cut array
CounterManager cuts_;
// Declaring shortcut to histograms
//HistoFreque
TH1I* H0_;
float vel=0.0;
//pdgID codes for particles
int ePDGID=11;
int muPDGID=13;
int piPDGID=2110;
//declare counters
float muonN2;
float pionN2;
float elecN2;
int zdN;
int muonN;
int pionN;
int elecN;
const MCParticleFormat* d1;
const MCParticleFormat* d2;
};
}
#endif
Question information
- Language:
- English Edit question
- Status:
- Answered
- Assignee:
- No assignee Edit question
- Last query:
- Last reply:
Can you help with this problem?
Provide an answer of your own, or ask Sarah Ferguson for more information if necessary.