Dear all,
I just install the root49 lib,according to the introduction
of install,I try to compile and link the macro program V0Example.C
when I type :
[fengsq@na49 macro]$ make -f Makefile.Macro
g++ -O -Wall -fPIC -fno-rtti -fno-exceptions -I/ROOT/root/include
-I/na49/local/root/include -I/na49/pro/inc -I/na49/pro/T49/T49DST/inc
-I/na49/pro/T49/T49DST/inc -I/na49/pro/T49/T49ANA/inc -c V0Example.C
V0Example.C: In function `int main(int, char **)':
V0Example.C:112: no matching function for call to
`T49CutV0::SetV0TrackArray (TClonesArray *&)'
V0Example.C:123: `V0TrackList' undeclared (first use this function)
V0Example.C:123: (Each undeclared identifier is reported only once
V0Example.C:123: for each function it appears in.)
gmake: *** [V0Example.o] Error 1
The V0Example.C is Example macro for V0 analysis as follow:
#ifndef __CINT_
// C++
#include <stdio.h>
#include <math.h>
// ROOT
#include <TROOT.h>
#include <TSystem.h>
#include <TClassTable.h>
#include <TFile.h>
#include <TObject.h>
#include <TObjArray.h>
#include <TClonesArray.h>
#include <TCanvas.h>
#include <TH1.h>
#include <TH2.h>
#include <TMath.h>
// T49DST
#include <T49Run.h>
#include <T49EventRoot.h>
#include <T49DstVertex.h>
#include <T49DstParticle.h>
// T49ANA
#include <T49V0Minv.h>
#include <T49CutV0.h>
//extern void InitGui();
//VoidFuncPtr_t initfuncs[] = {InitGui, 0};
TROOT root("Rint","Root class");
int main (int argc, char **argv)
#else
void V0Example()
#endif
{
#ifdef __CINT__
// Reset the ROOT environment
gROOT.Reset();
// Dynamically link some shared libs
gSystem->Load("LibT49DST.so");
gSystem->Load("libT49ANA.so");
#endif
T49EventRoot *Event;
TObjArray *V0List;
T49DstVertex *V0;
TObjArray *VertexList;
T49DstParticle *MainTrack;
T49DstVertex *MainVertex;
TClonesArray *MainTrackList;
TClonesArray *SecTrackList;
//define a V0TrackList
//TClonesArray *V0TrackList;
T49V0Minv *Lambda = new T49V0Minv("minLambda","Invariant mass
spectra for the lambda","L",3,0.0,3.0,2,1.5,4.5);
T49CutV0 *V0Cut = new T49CutV0("cuts","V0 cuts");
T49Run *Run = new T49Run();
// maximum number of events to process
const Int_t maxEvent = 1000;
// Open the ROOT-Mini-DST
Run->Open("/home/fengsq/run2625.2.root");
TH2F *hArmenteros = new TH2F("hArmenteros","Armenteros Plot"
,60,-1.1,1.1,25,0.0,0.25);
TH1F *hCosThe = new TH1F("hCosThe" ,"Cos(theta)
lambda",100,-1.5,1.5);
TH1F *hLifetime = new TH1F("hLifetime" ,"Lifetime lambda (10^-10!
s)",100,0,10);
TH1F *hPosPt = new TH1F("hPosPt" ,"positive daughter pt
(non-vtx)" ,50,0,5);
TH1F *hNegPt = new TH1F("hNegPt" ,"negative daughter pt
(non-vtx)" ,50,0,5);
TH1F *hPosMainPt = new TH1F("hPosMainPt","positive daughter pt
(main-vtx)",50,0,5);
TH1F *hNegMainPt = new TH1F("hNegMainPt","negative daughter pt
(main-vtx)",50,0,5);
// Define the V0-cuts
V0Cut->SetStandardCuts();
V0Cut->SetVerbose(1);
Int_t nEvent = 0;
while ((Event = (T49EventRoot *) Run->GetNextEvent()) &&
(nEvent < maxEvent)) {
// Get the list of all main-vertex tracks
MainTrackList = Event->GetPrimaryParticles();
// Get the list of all secondary daughter tracks
SecTrackList = Event->GetSecondaryParticles();
// Get the list with all vertices (main + V0)
VertexList = Event->GetVertices();
cout << " Run " << Event->GetNRun()
<< " event " << Event->GetNEvent()
<< " with " << VertexList->GetEntries()
<< " vertices " << endl;
// Get the main vertex (needed for the V0 lifetime)
// The first in the list is the geometrical target position,
// the second one the fitted vertex position
MainVertex = (T49DstVertex *) VertexList->At(1);
if (MainVertex->GetIdVtx() == 11) {
cout << " No fitted main vertex" << endl;
MainVertex = (T49DstVertex *) VertexList->At(0);
}
// Reconstruct the pointer to the V0 daughter tracks
V0Cut->SetV0TrackArray(SecTrackList);
// Get the list of accepted V0s
V0List = V0Cut->GetAcceptedV0s(VertexList);
// Loop through all accepted V0s
for (Int_t idxV0 = 0; idxV0 < V0List->GetEntries(); idxV0++) {
V0 = (T49DstVertex *) V0List->At(idxV0);
// Reconstruct the pointers to the daughter tracks
V0->SetDaughters(V0TrackList);
// Fill the invariant mass spectra
Lambda->Fill(V0);
// Fill histograms
hArmenteros->Fill(V0->GetArmenterosAlpha(),V0->GetArmenterosPt());
hCosThe->Fill(V0->GetCosThetaLambda());
hLifetime->Fill(V0->GetLifetimeLambda(MainVertex));
// The daughter tracks (no TOF- and dEdx-information)
hPosPt->Fill(V0->GetPositiveTrack()->GetPt());
hNegPt->Fill(V0->GetNegativeTrack()->GetPt());
// Get the main-vertex tracks (only global tracks) of the daughters
// Needed to have access to, e.g., the TOF- and dEdx-information
if ((MainTrack = V0->GetPositiveMainTrack(MainTrackList)))
hPosMainPt->Fill(MainTrack->GetPt());
if ((MainTrack = V0->GetNegativeMainTrack(MainTrackList)))
hNegMainPt->Fill(MainTrack->GetPt());
}
// Count the number of events
Lambda->IncrementEvent();
nEvent++;
}
// Print the definition of the invariant mass spectra
Lambda->Print();
// Draw the invariant mass spectra
Lambda->Draw();
// Print the cut statistics
V0Cut->PrintCuts();
V0Cut->PrintStatistics();
// Draw the other histograms
TCanvas *c1 = new TCanvas("c1","V0Example",10,10,600,900);
c1->Divide(1,3);
c1->cd(1);
hArmenteros->SetXTitle("Alpha");
hArmenteros->SetYTitle("Pt (GeV/c)");
hArmenteros->Draw();
c1->cd(2);
gPad->Divide(2,1);
gPad->cd(1);
gPad->SetLogy();
hPosPt->SetLineColor(38);
hPosPt->SetXTitle("pt (GeV/c)");
hPosPt->Draw();
hPosMainPt->SetLineColor(46);
hPosMainPt->Draw("SAME");
c1->cd(2);
gPad->cd(2);
gPad->SetLogy();
hNegPt->SetLineColor(38);
hNegPt->SetXTitle("pt (GeV/c)");
hNegPt->Draw();
hNegMainPt->SetLineColor(46);
hNegMainPt->Draw("SAME");
c1->cd(3);
gPad->Divide(2,1);
gPad->cd(1);
hCosThe->SetLineColor(46);
hCosThe->SetXTitle("cos(theta)");
hCosThe->Draw();
c1->cd(3);
gPad->cd(2);
gPad->SetLogy();
hLifetime->SetLineColor(46);
hLifetime->SetXTitle("lifetime (10^10! s");
hLifetime->Draw();
// Save the V0Minv-class
TFile *fout = new TFile("lambda.root","RECREATE");
Lambda->Write();
fout->Close();
//Run->Close();
#ifndef __CINT__
return 0;
#endif
}
Best regards,Shengqin
This archive was generated by hypermail 2b29 : Tue Jan 04 2000 - 00:43:43 MET