/*
$Log$
+Revision 1.9 2000/12/21 16:24:06 morsch
+Coding convention clean-up
+
Revision 1.8 2000/10/27 13:53:29 morsch
AddGenerator: check testbit before setting the pT and momentum range
(D.Y. Peressounko)
AliGenCocktailEntry *entry;
AliGenCocktailEntry *e1;
AliGenCocktailEntry *e2;
- TClonesArray *partArray = gAlice->Particles();
+ TObjArray *partArray = gAlice->Particles();
//
// Loop over generators and generate events
Int_t igen=0;
/*
$Log$
+Revision 1.31 2001/01/17 10:54:31 hristov
+Better protection against FPE
+
Revision 1.30 2000/12/18 08:55:35 morsch
Make AliPythia dependent generartors work with new scheme of random number generation
{
// Adjust the weights after generation of all events
//
- TClonesArray *partArray = gAlice->Particles();
TParticle *part;
Int_t ntrack=gAlice->GetNtrack();
for (Int_t i=0; i<ntrack; i++) {
- part= (TParticle*) partArray->UncheckedAt(i);
+ part= gAlice->Particle(i);
part->SetWeight(part->GetWeight()*fKineBias);
}
}
#pragma link C++ enum Param_t;
#pragma link C++ enum Weighting_t;
-#pragma link C++ class AliGenHIJINGpara;
-#pragma link C++ class AliGenFixed;
-#pragma link C++ class AliGenBox;
-#pragma link C++ class AliGenParam;
+#pragma link C++ class AliGenHIJINGpara+;
+#pragma link C++ class AliGenFixed+;
+#pragma link C++ class AliGenBox+;
+#pragma link C++ class AliGenParam+;
#pragma link C++ class AliGenPythia-;
-#pragma link C++ class AliGenCocktail;
-#pragma link C++ class AliGenCocktailEntry;
-#pragma link C++ class AliGenExtFile;
-#pragma link C++ class AliGenScan;
-#pragma link C++ class AliGenDoubleScan;
-#pragma link C++ class AliPythia;
-#pragma link C++ class AliGenLib;
-#pragma link C++ class AliGenMUONlib;
-#pragma link C++ class AliGenFLUKAsource;
-#pragma link C++ class AliGenHalo;
-#pragma link C++ class AliGenHaloProtvino;
-#pragma link C++ class AliDimuCombinator;
-#pragma link C++ class AliGenPHOSlib;
-#pragma link C++ class AliGenGSIlib;
-#pragma link C++ class AliGenPMDlib;
-#pragma link C++ class AliGenEventHeader;
-#pragma link C++ class AliGenHijingEventHeader;
-#pragma link C++ class AliGenHijing;
-#pragma link C++ class AliDecayer;
+#pragma link C++ class AliGenCocktail+;
+#pragma link C++ class AliGenCocktailEntry+;
+#pragma link C++ class AliGenExtFile+;
+#pragma link C++ class AliGenExtFileCH+;
+#pragma link C++ class AliGenScan+;
+#pragma link C++ class AliGenDoubleScan+;
+#pragma link C++ class AliPythia+;
+#pragma link C++ class AliGenLib+;
+#pragma link C++ class AliGenMUONlib+;
+#pragma link C++ class AliGenFLUKAsource+;
+#pragma link C++ class AliGenHalo+;
+#pragma link C++ class AliGenHaloProtvino+;
+#pragma link C++ class AliDimuCombinator+;
+#pragma link C++ class AliGenPHOSlib+;
+#pragma link C++ class AliGenGSIlib+;
+#pragma link C++ class AliGenPMDlib+;
+#pragma link C++ class AliGenEventHeader+;
+#pragma link C++ class AliGenHijingEventHeader+;
+#pragma link C++ class AliGenHijing+;
+#pragma link C++ class AliDecayer+;
#pragma link C++ class AliDecayerPythia-;
+#pragma link C++ class AliGenMuonHits+;
#endif
#pragma link off all classes;
#pragma link off all functions;
-#pragma link C++ class AliFMD;
-#pragma link C++ class AliFMDv0;
-#pragma link C++ class AliFMDv1;
-#pragma link C++ class AliFMDhit;
+#pragma link C++ class AliFMD+;
+#pragma link C++ class AliFMDv0+;
+#pragma link C++ class AliFMDv1+;
+#pragma link C++ class AliFMDhit+;
#endif
#pragma link C++ global gAlice;
-#pragma link C++ class AliGShape;
-#pragma link C++ class AliGBox;
+#pragma link C++ class AliGShape+;
+#pragma link C++ class AliGBox+;
#pragma link C++ class AliGSphere-;
-#pragma link C++ class AliGTransform;
+#pragma link C++ class AliGTransform+;
#pragma link C++ class AliGMaterial-;
-#pragma link C++ class AliGSuperShape;
-#pragma link C++ class AliGConfig;
-#pragma link C++ class AliGNode;
-#pragma link C++ class AliGCone;
+#pragma link C++ class AliGSuperShape+;
+#pragma link C++ class AliGConfig+;
+#pragma link C++ class AliGNode+;
+#pragma link C++ class AliGCone+;
#pragma link C++ class AliGTube-;
#pragma link C++ class AliGPCone-;
-#pragma link C++ class AliGTRD1;
-#pragma link C++ class AliGeometry;
+#pragma link C++ class AliGTRD1+;
+#pragma link C++ class AliGeometry+;
-#pragma link C++ class AliGEODB;
+#pragma link C++ class AliGEODB+;
#endif
/*
$Log$
+Revision 1.28 2000/12/18 14:02:00 barbera
+new version of the ITS tracking to take into account the new TPC track parametrization
+
Revision 1.27 2000/12/08 13:49:27 barbera
Hidden declaration in a for loop removed to be compliant with HP-UX compiler
}
//_____________________________________________________________________________
-void AliITS::MakeBranch(Option_t* option){
+void AliITS::MakeBranch(Option_t* option, char *file)
+{
//
// Creates Tree branches for the ITS.
//
-
-
+ //
Int_t buffersize = 4000;
char branchname[30];
sprintf(branchname,"%s",GetName());
- AliDetector::MakeBranch(option);
+ AliDetector::MakeBranch(option,file);
+ char *cD = strstr(option,"D");
+ char *cR = strstr(option,"R");
-// one branch for digits per type of detector
-
+ if (cD) {
+ //
+ // one branch for digits per type of detector
+ //
char *det[3] = {"SPD","SDD","SSD"};
char digclass[40];
(*fCtype)[i] = new TClonesArray(clclass,10000);
}
-
- for (i=0; i<fgkNTYPES ;i++) {
+ for (i=0; i<fgkNTYPES ;i++) {
if (fgkNTYPES==3) sprintf(branchname,"%sDigits%s",GetName(),det[i]);
- else sprintf(branchname,"%sDigits%d",GetName(),i+1);
-
- if (fDtype && gAlice->TreeD()) {
- gAlice->TreeD()->Branch(branchname,&((*fDtype)[i]), buffersize);
- cout << "Making Branch " << branchname;
- cout << " for digits of type "<< i+1 << endl;
+ else sprintf(branchname,"%sDigits%d",GetName(),i+1);
+ if (fDtype && gAlice->TreeD()) {
+ gAlice->MakeBranchInTree(gAlice->TreeD(),
+ branchname, &((*fDtype)[i]), buffersize, file) ;
+ cout << "Making Branch " << branchname;
+ cout << " for digits of type "<< i+1 << endl;
}
+ }
}
+ if (cR) {
+ //
// only one branch for rec points for all detector types
- sprintf(branchname,"%sRecPoints",GetName());
-
- fRecPoints=new TClonesArray("AliITSRecPoint",10000);
+ //
+ sprintf(branchname,"%sRecPoints",GetName());
+
+ fRecPoints=new TClonesArray("AliITSRecPoint",10000);
- if (fRecPoints && gAlice->TreeR()) {
- gAlice->TreeR()->Branch(branchname,&fRecPoints, buffersize);
- cout << "Making Branch " << branchname;
- cout << " for reconstructed space points" << endl;
+ if (fRecPoints && gAlice->TreeR()) {
+ gAlice->MakeBranchInTree(gAlice->TreeR(),
+ branchname, &fRecPoints, buffersize, file) ;
+ cout << "Making Branch " << branchname;
+ cout << " for reconstructed space points" << endl;
+ }
}
-
-
}
//___________________________________________
//printf("background - ntracks1 - %d\n",ntracks1);
}
- Int_t npart = gAlice->GetEvent(evnt);
- if(npart<=0) return;
+ //Int_t npart = gAlice->GetEvent(evnt);
+ //if(npart<=0) return;
TClonesArray *itsHits = this->Hits();
Int_t lay,lad,det,index;
AliITShit *itsHit=0;
}
+//____________________________________________________________________________
+
+void AliITS::SDigits2Digits()
+{
+
+ AliITSgeom *geom = GetITSgeom();
+
+ // SPD
+ AliITSDetType *iDetType;
+ iDetType=DetType(0);
+ AliITSsegmentationSPD *seg0=(AliITSsegmentationSPD*)iDetType->GetSegmentationModel();
+ AliITSresponseSPD *res0 = (AliITSresponseSPD*)iDetType->GetResponseModel();
+ AliITSsimulationSPD *sim0=new AliITSsimulationSPD(seg0,res0);
+ SetSimulationModel(0,sim0);
+ // test
+ // printf("SPD dimensions %f %f \n",seg0->Dx(),seg0->Dz());
+ // printf("SPD npixels %d %d \n",seg0->Npz(),seg0->Npx());
+ // printf("SPD pitches %d %d \n",seg0->Dpz(0),seg0->Dpx(0));
+ // end test
+ //
+ // SDD
+ //Set response functions
+ Float_t baseline = 10.;
+ Float_t noise = 1.75;
+
+ // SDD compression param: 2 fDecrease, 2fTmin, 2fTmax or disable, 2 fTolerance
+
+ iDetType=DetType(1);
+ AliITSresponseSDD *res1 = (AliITSresponseSDD*)iDetType->GetResponseModel();
+ if (!res1) {
+ res1=new AliITSresponseSDD();
+ SetResponseModel(1,res1);
+ }
+ res1->SetMagicValue(900.);
+ Float_t maxadc = res1->MaxAdc();
+ Float_t topValue = res1->MagicValue();
+ Float_t norm = maxadc/topValue;
+
+ Float_t fCutAmp = baseline + 2.*noise;
+ fCutAmp *= norm;
+ Int_t cp[8]={0,0,(int)fCutAmp,(int)fCutAmp,0,0,0,0}; //1D
+
+ //res1->SetZeroSupp("2D");
+ res1->SetZeroSupp("1D");
+ res1->SetNoiseParam(noise,baseline);
+ res1->SetDo10to8(kTRUE);
+ res1->SetCompressParam(cp);
+ res1->SetMinVal(4);
+ res1->SetDiffCoeff(3.6,40.);
+ //res1->SetMagicValue(96.95);
+ AliITSsegmentationSDD *seg1=(AliITSsegmentationSDD*)iDetType->GetSegmentationModel();
+ if (!seg1) {
+ seg1 = new AliITSsegmentationSDD(geom,res1);
+ SetSegmentationModel(1,seg1);
+ }
+ AliITSsimulationSDD *sim1=new AliITSsimulationSDD(seg1,res1);
+ sim1->SetDoFFT(1);
+ sim1->SetCheckNoise(kFALSE);
+ SetSimulationModel(1,sim1);
+
+ // SSD
+ iDetType=DetType(2);
+ AliITSsegmentationSSD *seg2=(AliITSsegmentationSSD*)iDetType->GetSegmentationModel();
+ AliITSresponseSSD *res2 = (AliITSresponseSSD*)iDetType->GetResponseModel();
+ res2->SetSigmaSpread(3.,2.);
+ AliITSsimulationSSD *sim2=new AliITSsimulationSSD(seg2,res2);
+ SetSimulationModel(2,sim2);
+
+ cerr<<"Digitizing ITS...\n";
+
+ TStopwatch timer;
+ timer.Start();
+ HitsToDigits(0,0,-1," ","All"," ");
+ timer.Stop(); timer.Print();
+
+ delete sim0;
+ delete sim1;
+ delete sim2;
+}
+
//____________________________________________________________________________
void AliITS::HitsToDigits(Int_t evNumber,Int_t bgrev,Int_t size, Option_t *option, Option_t *opt,Text_t *filename)
char hname[30];
sprintf(hname,"TreeD%d",evNumber);
- gAlice->TreeD()->Write(hname);
+ gAlice->TreeD()->Write(hname,TObject::kOverwrite);
// reset tree
gAlice->TreeD()->Reset();
char hname[30];
sprintf(hname,"TreeR%d",evNumber);
- gAlice->TreeR()->Write(hname);
+ gAlice->TreeR()->Write(hname,TObject::kOverwrite);
// reset tree
gAlice->TreeR()->Reset();
char hname[30];
sprintf(hname,"TreeR%d",evNumber);
- gAlice->TreeR()->Write(hname);
+ gAlice->TreeR()->Write(hname,TObject::kOverwrite);
// reset tree
gAlice->TreeR()->Reset();
#include <TObjArray.h> // used in inline function GetModule.
#include "AliDetector.h"
+#include "AliITSsimulationSPD.h"
+#include "AliITSsimulationSDD.h"
+#include "AliITSsimulationSSD.h"
class TString;
class TTree;
// create separate tree for clusters - declustering refining
virtual void MakeTreeC(Option_t *option="C");
void GetTreeC(Int_t event);
- virtual void MakeBranch(Option_t *opt=" ");
+ virtual void MakeBranch(Option_t *opt=" ", char *file=0);
void SetTreeAddress();
virtual void SetEUCLID(Bool_t euclid=1) {fEuclidOut = euclid;}
virtual void StepManager() {}
Int_t nmodules,Option_t *opt,Text_t *filename);
virtual void ClearModules();
// Digitisation
+ virtual void SDigits2Digits();
void HitsToDigits(Int_t evNumber,Int_t bgrev,Int_t size,
Option_t *add, Option_t *det, Text_t *filename);
// Reconstruct hits
AliITSsimulationSSD *sim2=new AliITSsimulationSSD(seg2,res2);
ITS->SetSimulationModel(2,sim2);
-
cerr<<"Digitizing ITS...\n";
TStopwatch timer;
private:
Int_t fTrans; //Flag to keep track of which transformation
Int_t fNlayers; //The number of layers.
- Int_t *fNlad; //Array of the number of ladders/layer(layer)
- Int_t *fNdet; //Array of the number of detectors/ladder(layer)
+ Int_t fNmodules;//The total number of modules
+ Int_t *fNlad; //!Array of the number of ladders/layer(layer)
+ Int_t *fNdet; //!Array of the number of detectors/ladder(layer)
AliITSgeomMatrix **fGm; //[fNmodules] Structure of trans. and rotation.
TObjArray *fShape; //Array of shapes and detector information.
- Int_t fNmodules;//The total number of modules
ClassDef(AliITSgeom,2) // ITS geometry class
};
/*
$Log$
+Revision 1.9 2000/10/02 16:32:51 barbera
+Automatic streamer used and forward declarations added
+
Revision 1.3.4.7 2000/10/02 15:54:49 barbera
Automatic streamer used and forward declarations added
// this hit. From the TParticle all kinds of information about this
// particle can be found. See the TParticle class.
////////////////////////////////////////////////////////////////////////
- TClonesArray *parts = gAlice->Particles();
- return ((TParticle*)parts->UncheckedAt(this->GetTrack()));
+ return gAlice->Particle(GetTrack());
}
/*
//___________________________________________________________________________
/*
$Log$
+Revision 1.1.2.1 2001/01/15 13:38:32 barbera
+New ITS detailed geometry to be used for the PPR
+
Revision 1.12 2000/12/10 16:00:44 barbera
Added last definition of special media like end-ladder boxes and cones
////////////////////////////////////////////////////////////////////////
//INNER RADII OF THE SILICON LAYERS
- Float_t rl[6] = { 3.8095,7.,15.,24.,38.1,43.5765 };
+ // Float_t rl[6] = { 3.8095,7.,15.,24.,38.1,43.5765 };
//THICKNESSES OF LAYERS (in % radiation length)
Float_t drl[6] = { 1.03,1.03,0.94,0.95,0.91,0.87 };
//HALF LENGTHS OF LAYERS
+ /*
Float_t dzl[6] = { 14.35,14.35,25.1,32.1,49.405,55.27 };
//LENGTHS OF END-LADDER BOXES (ALL INCLUDED)
Float_t dzb[6] = { 12.4,12.4,13.5,15.,7.5,7.5 };
//THICKNESSES OF END-LADDER BOXES (ALL INCLUDED)
Float_t drb[6] = { rl[1]-rl[0],0.2,5.,5.,4.,4. };
+ */
Float_t dits[50], rlim, zmax;
- Float_t zpos;
- Float_t pcits[50], xltpc;
+ Float_t xltpc;
Int_t idrotm[999], i;
Float_t dgh[50];
**************************************************************************/
/*
$Log$
+Revision 1.44 2001/01/25 17:39:09 morsch
+Pass size of fNdch and fNrawch to CINT.
+
Revision 1.43 2001/01/23 18:58:19 hristov
Initialisation of some pointers
<img src="gif/alimuon.gif">
*/
//End_Html
- fHits2 = 0;
- fPadHits2 = 0;
- fFileName = 0;
- fTrH1 = 0;
fHits = new TClonesArray("AliMUONHit",1000);
gAlice->AddHitList(fHits);
}
//___________________________________________
-void AliMUON::MakeBranch(Option_t* option)
+void AliMUON::MakeBranch(Option_t* option, char *file)
{
+ //
// Create Tree branches for the MUON.
+ //
const Int_t kBufferSize = 4000;
char branchname[30];
sprintf(branchname,"%sCluster",GetName());
- AliDetector::MakeBranch(option);
-
- if (fPadHits && gAlice->TreeH()) {
- gAlice->TreeH()->Branch(branchname,&fPadHits, kBufferSize);
- printf("Making Branch %s for clusters\n",branchname);
- }
-
-// one branch for digits per chamber
- Int_t i;
+ AliDetector::MakeBranch(option,file);
- for (i=0; i<AliMUONConstants::NCh() ;i++) {
- sprintf(branchname,"%sDigits%d",GetName(),i+1);
-
- if (fDchambers && gAlice->TreeD()) {
- gAlice->TreeD()->Branch(branchname,&((*fDchambers)[i]), kBufferSize);
- printf("Making Branch %s for digits in chamber %d\n",branchname,i+1);
- }
+ char *cD = strstr(option,"D");
+ char *cR = strstr(option,"R");
+ char *cH = strstr(option,"H");
+
+ if (fPadHits && gAlice->TreeH() && cH) {
+ gAlice->MakeBranchInTree(gAlice->TreeH(),
+ branchname, &fPadHits, kBufferSize, file) ;
+ printf("Making Branch %s for clusters\n",branchname);
}
- printf("Make Branch - TreeR address %p\n",gAlice->TreeR());
+ if (cD) {
+ //
+ // one branch for digits per chamber
+ //
+ Int_t i;
-// one branch for raw clusters per chamber
- for (i=0; i<AliMUONConstants::NTrackingCh() ;i++) {
- sprintf(branchname,"%sRawClusters%d",GetName(),i+1);
-
- if (fRawClusters && gAlice->TreeR()) {
- gAlice->TreeR()->Branch(branchname,&((*fRawClusters)[i]), kBufferSize);
- printf("Making Branch %s for raw clusters in chamber %d\n",branchname,i+1);
- }
- }
-
-// one branch for global trigger
- sprintf(branchname,"%sGlobalTrigger",GetName());
- if (fGlobalTrigger && gAlice->TreeR()) {
- gAlice->TreeR()->Branch(branchname,&fGlobalTrigger,kBufferSize);
- printf("Making Branch %s for Global Trigger\n",branchname);
- }
-// one branch for local trigger
- sprintf(branchname,"%sLocalTrigger",GetName());
- if (fLocalTrigger && gAlice->TreeR()) {
- gAlice->TreeR()->Branch(branchname,&fLocalTrigger,kBufferSize);
- printf("Making Branch %s for Local Trigger\n",branchname);
+ for (i=0; i<AliMUONConstants::NCh() ;i++) {
+ sprintf(branchname,"%sDigits%d",GetName(),i+1);
+ if (fDchambers && gAlice->TreeD()) {
+ gAlice->MakeBranchInTree(gAlice->TreeD(),
+ branchname, &((*fDchambers)[i]), kBufferSize, file) ;
+ printf("Making Branch %s for digits in chamber %d\n",branchname,i+1);
+ }
+ }
}
+ if (cR) {
+ //
+ // one branch for raw clusters per chamber
+ //
+ printf("Make Branch - TreeR address %p\n",gAlice->TreeR());
+
+ Int_t i;
+
+ for (i=0; i<AliMUONConstants::NTrackingCh() ;i++) {
+ sprintf(branchname,"%sRawClusters%d",GetName(),i+1);
+ if (fRawClusters && gAlice->TreeR()) {
+ gAlice->MakeBranchInTree(gAlice->TreeR(),
+ branchname, &((*fRawClusters)[i]), kBufferSize, file) ;
+ printf("Making Branch %s for raw clusters in chamber %d\n",branchname,i+1);
+ }
+ }
+ //
+ // one branch for global trigger
+ //
+ sprintf(branchname,"%sGlobalTrigger",GetName());
+ if (fGlobalTrigger && gAlice->TreeR()) {
+ gAlice->MakeBranchInTree(gAlice->TreeR(),
+ branchname, &fGlobalTrigger, kBufferSize, file) ;
+ printf("Making Branch %s for Global Trigger\n",branchname);
+ }
+ //
+ // one branch for local trigger
+ //
+ sprintf(branchname,"%sLocalTrigger",GetName());
+ if (fLocalTrigger && gAlice->TreeR()) {
+ gAlice->MakeBranchInTree(gAlice->TreeR(),
+ branchname, &fLocalTrigger, kBufferSize, file) ;
+ printf("Making Branch %s for Local Trigger\n",branchname);
+ }
+ }
}
//___________________________________________
((AliMUONChamber*) (*fChambers)[id])->SetNsec(nsec);
}
-
//___________________________________________
+void AliMUON::SDigits2Digits()
+{
+ Int_t evNumber2=0, ibg=0, bgr=0;
+ Int_t nbgr_ev= 0, nev=0;
+ Int_t nparticles = gAlice->GetNtrack();
+ cout << "nev " <<nev<<endl;
+ cout << "nparticles " <<nparticles<<endl;
+ if (nparticles <= 0) return;
+ nbgr_ev = Int_t(nev*bgr/(evNumber2+1));
+
+ if (ibg) {
+ printf("nbgr_ev %d\n",nbgr_ev);
+ Digitise(nev,nbgr_ev,"Add"," ","galice_bgr.root");
+ }
+ else {
+ Digitise(nev,nbgr_ev,"rien","","");
+ }
+}
+//___________________________________________
void AliMUON::MakePadHits(Float_t xhit,Float_t yhit, Float_t zhit,
Float_t eloss, Float_t tof, Int_t idvol)
{
delete [] hitMap;
char hname[30];
sprintf(hname,"TreeD%d",nev);
- gAlice->TreeD()->Write(hname);
+ gAlice->TreeD()->Write(hname,TObject::kOverwrite);
// reset tree
gAlice->TreeD()->Reset();
delete list;
ResetTrigger();
char hname[30];
sprintf(hname,"TreeR%d",nev);
- gAlice->TreeR()->Write(hname);
+ gAlice->TreeR()->Write(hname,TObject::kOverwrite);
gAlice->TreeR()->Reset();
printf("\n End of trigger for event %d", nev);
}
ResetRawClusters();
char hname[30];
sprintf(hname,"TreeR%d",nev);
- gAlice->TreeR()->Write(hname);
+ gAlice->TreeR()->Write(hname,TObject::kOverwrite);
gAlice->TreeR()->Reset();
printf("\n End of cluster finding for event %d", nev);
//gObjectTable->Print();
}
-
+#ifdef never
void AliMUON::Streamer(TBuffer &R__b)
{
// Stream an object of class AliMUON.
}
}
}
+#endif
+
AliMUONPadHit* AliMUON::FirstPad(AliMUONHit* hit, TClonesArray *clusters)
{
//
TClonesArray *PadHits() {return fPadHits;}
TClonesArray *LocalTrigger() {return fLocalTrigger;}
TClonesArray *GlobalTrigger() {return fGlobalTrigger;}
- virtual void MakeBranch(Option_t *opt=" ");
+ virtual void MakeBranch(Option_t *opt=" ", char *file=0);
void SetTreeAddress();
virtual void ResetHits();
virtual void ResetDigits();
// Cluster Finding
virtual void FindClusters(Int_t event ,Int_t lastEntry);
// Digitisation
+ virtual void SDigits2Digits();
virtual void Digitise(Int_t nev,Int_t bgrEvent, Option_t *opt1=" ",
Option_t *opt2=" ",Text_t *name=" ");
virtual void SortTracks(Int_t *tracks,Int_t *charges, Int_t ntr);
//__________________________________________________________________________
AliMUONEventReconstructor::AliMUONEventReconstructor(void)
{
- fBkgGeantFile = 0;
- fBkgGeantTK = 0;
- fBkgGeantParticles = 0;
- fBkgGeantTH = 0;
- fBkgGeantHits = 0;
-
// Constructor for class AliMUONEventReconstructor
SetReconstructionParametersToDefaults();
// Memory allocation for the TClonesArray of hits for reconstruction
AliMUONTrack *track;
AliMUONTrackParam *trackParam, *trackParam1;
- TClonesArray *particles; // pointer to the particle list
TParticle *p;
Double_t bendingSlope, nonBendingSlope, pYZ;
Double_t pX, pY, pZ, x, y, z, c;
z, x, y, pX, pY, pZ, c);
}
// informations about generated particles
- particles = gAlice->Particles();
- np = particles->GetEntriesFast();
+ np = gAlice->GetNtrack();
printf(" **** number of generated particles: %d \n", np);
for (Int_t iPart = 0; iPart < np; iPart++) {
- p = (TParticle*) particles->UncheckedAt(iPart);
+ p = gAlice->Particle(iPart);
printf(" particle %d: type= %d px= %f py= %f pz= %f pdg= %d\n",
iPart, p->GetPdgCode(), p->Px(), p->Py(), p->Pz(), p->GetPdgCode());
}
/*
$Log$
+Revision 1.4 2000/12/21 22:14:38 morsch
+Clean-up of coding rule violations.
+
Revision 1.3 2000/12/21 17:51:54 morsch
RN3 violations corrected
Revision 1.2 2000/11/23 10:09:39 gosset
Bug correction in AliMUONRecoDisplay.
Copyright, $Log$
+Copyright, Revision 1.4 2000/12/21 22:14:38 morsch
+Copyright, Clean-up of coding rule violations.
+Copyright,
Copyright, Revision 1.3 2000/12/21 17:51:54 morsch
Copyright, RN3 violations corrected
Copyright,, $Id$, comments at the right place for automatic documentation,
if (fEvGen) fEvGen->Clear();
fEvGen->SetNoEvent(nevent);
// get list of particles
- TClonesArray *particles = gAlice->Particles();
// connect MUON module
AliDetector *pMUON = gAlice->GetDetector("MUON");
if (!pMUON) {
for (Int_t track=0; track<ntracks; track++) {
hit = (AliMUONHit *) pMUON->FirstHit(track);
if (!hit) continue;
- particle = (TParticle *) particles->UncheckedAt(hit->Track());
+ particle = gAlice->Particle(hit->Track());
if (IsReconstructible(track) && TMath::Abs(particle->GetPdgCode())==13) {
gtrack = fEvGen->AddEmptyTrack();
gtrack->SetSign(TMath::Sign((Int_t)1, -particle->GetPdgCode()));
/*
$Log$
+Revision 1.3 2000/12/21 17:51:54 morsch
+RN3 violations corrected
+
Revision 1.2 2000/11/23 10:09:38 gosset
Bug correction in AliMUONRecoDisplay.
-Copyright, $Log$, $Id$, comments at the right place for automatic documentation,
+Copyright, $Log$
+Copyright, Revision 1.3 2000/12/21 17:51:54 morsch
+Copyright, RN3 violations corrected
+Copyright,, $Id$, comments at the right place for automatic documentation,
in AliMUONRecoEvent and AliMUONRecoDisplay
*/
#include <iostream.h>
#include <AliRun.h>
#include <TClonesArray.h>
+#include <TClass.h>
#include "AliMUONRecoEvent.h"
#include "AliMUONTrack.h"
#include "AliMUONTrackParam.h"
{
// Streams an object of class AliMUONRecoEvent
if (R__b.IsReading()) {
- Version_t R__v = R__b.ReadVersion(); if (R__v) { }
- TObject::Streamer(R__b);
- R__b >> fNevr;
- R__b >> fNtracks;
fTracks->Clear();
- fTracks->Streamer(R__b);
+ AliMUONRecoEvent::Class()->ReadBuffer(R__b, this);
} else {
cout << "...writing event to file...\n";
- R__b.WriteVersion(AliMUONRecoEvent::IsA());
- TObject::Streamer(R__b);
- R__b << fNevr;
- R__b << fNtracks;
- fTracks->Streamer(R__b);
+ AliMUONRecoEvent::Class()->WriteBuffer(R__b, this);
}
}
private:
Int_t fNevr; // event number
Int_t fNtracks; // number of tracks
- TClonesArray *fTracks; // list of AliMUONRecoTracks
+ TClonesArray *fTracks; //-> list of AliMUONRecoTracks
public:
AliMUONRecoEvent(Int_t eventNo = 0);
fSSigmaCut = 4.0;
fSXPrec = 0.01;
fSYPrec = 0.144;
- fFileName = 0;
}
//_____________________________________________________________________________
//__________________________________________
void AliMUONTrackReconstructor::FinishEvent()
{
-// Finish
- TTree *treeK = gAlice->TreeK();
- TFile *file1 = 0;
- if (treeK) file1 = treeK->GetCurrentFile();
- file1->cd();
+ // Finish
+ // TTree *treeK = gAlice->TreeK();
+ // TFile *file1 = 0;
+ // if (treeK) file1 = treeK->GetCurrentFile();
+ // file1->cd();
}
//_____________________________________
mHit=(AliMUONHit*)pMUON->NextHit())
{
if (mHit->fChamber > 10) continue;
- TClonesArray *fPartArray = gAlice->Particles();
Int_t ftrack = mHit->Track();
- Int_t id = ((TParticle*) fPartArray->UncheckedAt(ftrack))->GetPdgCode();
+ Int_t id = gAlice->Particle(ftrack)->GetPdgCode();
if (id==kMuonPlus||id==kMuonMinus) {
xgeant[nhittot1] = mHit->Y();
if (maxidg<=20000) {
if (mHit->fChamber > 10) continue;
- TClonesArray *fPartArray = gAlice->Particles();
TParticle *particle;
Int_t ftrack = mHit->Track();
- Int_t id = ((TParticle*) fPartArray->UncheckedAt(ftrack))->GetPdgCode();
+ Int_t id = gAlice->Particle(ftrack)->GetPdgCode();
// if (id==kMuonPlus||id==kMuonMinus) {
ptotg[maxidg] = mHit->fPTot; // P of hit
- particle = (TParticle*) fPartArray->UncheckedAt(ftrack);
+ particle = gAlice->Particle(ftrack);
Float_t thet = particle->Theta();
thet = thet*180./3.1416;
if (iparent >= 0) {
Int_t ip;
while(1) {
- ip=((TParticle*) fPartArray->UncheckedAt(iparent))->GetFirstMother();
+ ip=gAlice->Particle(iparent)->GetFirstMother();
if (ip < 0) {
break;
} else {
//printf("iparent - %d\n",iparent);
Int_t id1 = ftrack; // numero de la particule generee au vertex
Int_t idum = track+1;
- Int_t id2 = ((TParticle*) fPartArray->UncheckedAt(iparent))->GetPdgCode();
+ Int_t id2 = gAlice->Particle(iparent)->GetPdgCode();
if (id2==443) id2=114;
else id2=116;
itypg[mpoi]=0;
ihit = ihit-1;
if (ihit >=0 && itrack >=0) {
- TClonesArray *fPartArray = gAlice->Particles();
gAlice->ResetHits();
gAlice->TreeH()->GetEvent(itrack);
TClonesArray *pMUONhits = pMUON->Hits();
if (id == kMuonPlus) itypg[mpoi]=5;
if (id == kMuonMinus) itypg[mpoi]=6;
TParticle *particle;
- particle = (TParticle*)
- (fPartArray->UncheckedAt(mHit->Track()));
- TParticle* particleM=(TParticle*)
- (fPartArray->UncheckedAt(particle->GetFirstMother()));
+ particle = gAlice->Particle(mHit->Track());
+ TParticle* particleM=gAlice->Particle(particle->GetFirstMother());
Int_t iparent=particleM->GetPdgCode();
printf("\n Particle Id:%d %d \n", id, iparent);
if (iparent == 443) id2=114;
**************************************************************************/
/*
$Log$
+Revision 1.3 2000/10/11 09:19:12 egangler
+Corrected some bugs - it should compile now
+
Revision 1.2 2000/06/15 07:58:49 morsch
Code from MUON-dev joined
char hname[30];
sprintf(hname, "TreeD%d", evnb);
- gAlice->TreeD()->Write(hname);
+ gAlice->TreeD()->Write(hname,TObject::kOverwrite);
// reset tree
gAlice->TreeD()->Reset();
#pragma link off all globals;
#pragma link off all classes;
#pragma link off all functions;
-#pragma link C++ class AliMUON-;
-#pragma link C++ class AliMUONv0;
-#pragma link C++ class AliMUONv1;
-#pragma link C++ class AliMUONHit;
-#pragma link C++ class AliMUONPadHit;
-#pragma link C++ class AliMUONDigit;
-#pragma link C++ class AliMUONTransientDigit;
-#pragma link C++ class AliMUONReconstHit;
-#pragma link C++ class AliMUONRawCluster;
-#pragma link C++ class AliMUONGlobalTrigger;
-#pragma link C++ class AliMUONLocalTrigger;
-#pragma link C++ class AliMUONResponse;
-#pragma link C++ class AliMUONSegmentationV0;
-#pragma link C++ class AliMUONResponseV0;
-#pragma link C++ class AliMUONResponseTrigger;
-#pragma link C++ class AliMUONResponseTriggerV1;
-#pragma link C++ class AliMUONSegmentationV01;
-#pragma link C++ class AliMUONSegmentationV02;
-#pragma link C++ class AliMUONSegmentationV04;
-#pragma link C++ class AliMUONSegmentationV05;
-#pragma link C++ class AliMUONSegmentationV1;
-#pragma link C++ class AliMUONSegmentationTrigger;
-#pragma link C++ class AliMUONSegmentationTriggerX;
-#pragma link C++ class AliMUONSegmentationTriggerY;
-#pragma link C++ class AliMUONChamber;
-#pragma link C++ class AliMUONChamberTrigger;
-#pragma link C++ class AliMUONPoints;
-#pragma link C++ class AliMUONDisplay;
-#pragma link C++ class AliMUONClusterFinderVS;
-#pragma link C++ class AliMUONHitMapA1;
-#pragma link C++ class AliMUONTrackReconstructor;
-#pragma link C++ class AliMUONTriggerCircuit;
-#pragma link C++ class AliMUONTriggerLut;
-#pragma link C++ class AliMUONTriggerDecision;
-#pragma link C++ class AliMUONEventReconstructor;
-#pragma link C++ class AliMUONHitForRec;
-#pragma link C++ class AliMUONSegment;
-#pragma link C++ class AliMUONTrack;
-#pragma link C++ class AliMUONTrackHit;
-#pragma link C++ class AliMUONTrackParam;
-#pragma link C++ class AliMUONTriggerConstants;
-#pragma link C++ class AliMUONSegmentationSlatModule;
-#pragma link C++ class AliMUONSegmentationSlatModuleN;
-#pragma link C++ class AliMUONSegmentationSlat;
-#pragma link C++ class AliMUONSegmentationSlatN;
-#pragma link C++ class AliMUONConstants;
-#pragma link C++ class AliMUONClusterInput;
+#pragma link C++ class AliMUON+;
+#pragma link C++ class AliMUONv0+;
+#pragma link C++ class AliMUONv1+;
+#pragma link C++ class AliMUONHit+;
+#pragma link C++ class AliMUONPadHit+;
+#pragma link C++ class AliMUONDigit+;
+#pragma link C++ class AliMUONTransientDigit+;
+#pragma link C++ class AliMUONReconstHit+;
+#pragma link C++ class AliMUONRawCluster+;
+#pragma link C++ class AliMUONGlobalTrigger+;
+#pragma link C++ class AliMUONLocalTrigger+;
+#pragma link C++ class AliMUONResponse+;
+#pragma link C++ class AliMUONSegmentationV0+;
+#pragma link C++ class AliMUONResponseV0+;
+#pragma link C++ class AliMUONResponseTrigger+;
+#pragma link C++ class AliMUONResponseTriggerV1+;
+#pragma link C++ class AliMUONSegmentationV01+;
+#pragma link C++ class AliMUONSegmentationV02+;
+#pragma link C++ class AliMUONSegmentationV04+;
+#pragma link C++ class AliMUONSegmentationV05+;
+#pragma link C++ class AliMUONSegmentationV1+;
+#pragma link C++ class AliMUONSegmentationTrigger+;
+#pragma link C++ class AliMUONSegmentationTriggerX+;
+#pragma link C++ class AliMUONSegmentationTriggerY+;
+#pragma link C++ class AliMUONChamber+;
+#pragma link C++ class AliMUONChamberTrigger+;
+#pragma link C++ class AliMUONPoints+;
+#pragma link C++ class AliMUONDisplay+;
+#pragma link C++ class AliMUONClusterFinderVS+;
+#pragma link C++ class AliMUONHitMapA1+;
+#pragma link C++ class AliMUONTrackReconstructor+;
+#pragma link C++ class AliMUONTriggerCircuit+;
+#pragma link C++ class AliMUONTriggerLut+;
+#pragma link C++ class AliMUONTriggerDecision+;
+#pragma link C++ class AliMUONEventReconstructor+;
+#pragma link C++ class AliMUONHitForRec+;
+#pragma link C++ class AliMUONSegment+;
+#pragma link C++ class AliMUONTrack+;
+#pragma link C++ class AliMUONTrackHit+;
+#pragma link C++ class AliMUONTrackParam+;
+#pragma link C++ class AliMUONTriggerConstants+;
+#pragma link C++ class AliMUONSegmentationSlatModule+;
+#pragma link C++ class AliMUONSegmentationSlatModuleN+;
+#pragma link C++ class AliMUONSegmentationSlat+;
+#pragma link C++ class AliMUONSegmentationSlatN+;
+#pragma link C++ class AliMUONConstants+;
+#pragma link C++ class AliMUONClusterInput+;
#pragma link C++ class AliMUONRecoEvent-;
-#pragma link C++ class AliMUONRecoTrack;
-#pragma link C++ class AliMUONRecoDisplay;
+#pragma link C++ class AliMUONRecoTrack+;
+#pragma link C++ class AliMUONRecoDisplay+;
#endif
//////////////////////////////////////////////////////////////////////////////
// --- ROOT system ---
+class TFile;
#include "TTree.h"
// --- Standard library ---
gAlice->GetEvent(Nevent);
- TClonesArray * primaryList = gAlice->Particles();
-
TParticle * primary ;
Int_t iPrimary ;
- for ( iPrimary = 0 ; iPrimary < primaryList->GetEntries() ; iPrimary++)
+ for ( iPrimary = 0 ; iPrimary < gAlice->GetNtrack() ; iPrimary++)
{
- primary = (TParticle*)primaryList->At(iPrimary) ;
+ primary = gAlice->Particle(iPrimary) ;
Int_t primaryType = primary->GetPdgCode() ;
if( (primaryType == 211)||(primaryType == -211)||(primaryType == 2212)||(primaryType == -2212) ) {
Int_t moduleNumber ;
Double_t distance = minDistance ;
for ( index = 0 ; index < numberofprimaries ; index++){
- primary = (TParticle*)primaryList->At(listofprimaries[index]) ;
+ primary = gAlice->Particle(listofprimaries[index]) ;
Int_t moduleNumber ;
Double_t primX, primZ ;
fGeom->ImpactOnEmc(primary->Theta(), primary->Phi(), moduleNumber, primX, primZ) ;
if(closestPrimary >=0 ){
- Int_t primaryType = ((TParticle *)primaryList->At(closestPrimary))->GetPdgCode() ;
+ Int_t primaryType = gAlice->Particle(closestPrimary)->GetPdgCode() ;
if(primaryType==22)
recPhot->Fill(recZ,recX,recParticle->Energy()) ;
gAlice->TreeK()->GetEvent(0) ;
//=========== Gets the list of Primari Particles
- TClonesArray * primaryList = gAlice->Particles();
TParticle * primary ;
Int_t iPrimary ;
- for ( iPrimary = 0 ; iPrimary < primaryList->GetEntries() ; iPrimary++)
+ for ( iPrimary = 0 ; iPrimary < gAlice->GetNtrack() ; iPrimary++)
{
- primary = (TParticle*)primaryList->UncheckedAt(iPrimary) ;
+ primary = gAlice->Particle(iPrimary) ;
Int_t primaryType = primary->GetPdgCode() ;
if( primaryType == 22 ) {
Int_t moduleNumber ;
Double_t dXmin = 0.;
Double_t dZmin = 0. ;
for ( index = 0 ; index < numberofprimaries ; index++){
- primary = (TParticle*)primaryList->UncheckedAt(listofprimaries[index]) ;
+ primary = gAlice->Particle(listofprimaries[index]) ;
Int_t moduleNumber ;
Double_t primX, primZ ;
fGeom->ImpactOnEmc(primary->Theta(), primary->Phi(), moduleNumber, primX, primZ) ;
if(closestPrimary >=0 ){
totalRPwithPrim++;
- Int_t primaryType = ((TParticle *)primaryList->At(closestPrimary))->GetPdgCode() ;
-// TParticlePDG* pDGparticle = ((TParticle *)primaryList->At(closestPrimary))->GetPDG();
+ Int_t primaryType = gAlice->Particle(closestPrimary)->GetPdgCode() ;
+// TParticlePDG* pDGparticle = gAlice->ParticleAt(closestPrimary)->GetPDG();
// Double_t charge = PDGparticle->Charge() ;
// if(charge)
// cout <<"Primary " <<primaryType << " E " << ((TParticle *)primaryList->At(closestPrimary))->Energy() << endl ;
{
case 22:
primaryCode = 0; //Photon
- fhAllEnergy ->Fill(((TParticle *) primaryList->At(closestPrimary))->Energy(), recParticle->Energy()) ;
- fhAllPosition ->Fill(((TParticle *) primaryList->At(closestPrimary))->Energy(), minDistance) ;
+ fhAllEnergy ->Fill(gAlice->Particle(closestPrimary)->Energy(), recParticle->Energy()) ;
+ fhAllPosition ->Fill(gAlice->Particle(closestPrimary)->Energy(), minDistance) ;
fhAllPositionX->Fill(dXmin);
fhAllPositionZ->Fill(dZmin);
break;
{
case AliPHOSFastRecParticle::kGAMMA:
if(primaryType == 22){
- fhPhotEnergy->Fill(((TParticle *) primaryList->At(closestPrimary))->Energy(), recParticle->Energy() ) ;
- fhEMEnergy->Fill(((TParticle *) primaryList->At(closestPrimary))->Energy(), recParticle->Energy() ) ;
- fhPPSDEnergy->Fill(((TParticle *) primaryList->At(closestPrimary))->Energy(), recParticle->Energy() ) ;
+ fhPhotEnergy->Fill(gAlice->Particle(closestPrimary)->Energy(), recParticle->Energy() ) ;
+ fhEMEnergy->Fill(gAlice->Particle(closestPrimary)->Energy(), recParticle->Energy() ) ;
+ fhPPSDEnergy->Fill(gAlice->Particle(closestPrimary)->Energy(), recParticle->Energy() ) ;
- fhPhotPosition->Fill(((TParticle *) primaryList->At(closestPrimary))->Energy(),minDistance) ;
- fhEMPosition->Fill(((TParticle *) primaryList->At(closestPrimary))->Energy(),minDistance) ;
- fhPPSDPosition->Fill(((TParticle *) primaryList->At(closestPrimary))->Energy(),minDistance) ;
+ fhPhotPosition->Fill(gAlice->Particle(closestPrimary)->Energy(),minDistance) ;
+ fhEMPosition->Fill(gAlice->Particle(closestPrimary)->Energy(),minDistance) ;
+ fhPPSDPosition->Fill(gAlice->Particle(closestPrimary)->Energy(),minDistance) ;
fhPhotReg->Fill(CorrectEnergy(recParticle->Energy()) ) ;
fhPhotEM->Fill(CorrectEnergy(recParticle->Energy()) ) ;
case AliPHOSFastRecParticle::kELECTRON:
if(primaryType == 22){
fhPhotElec->Fill(CorrectEnergy(recParticle->Energy()) ) ;
- fhEMEnergy->Fill(((TParticle *) primaryList->At(closestPrimary))->Energy(), recParticle->Energy() ) ;
- fhEMPosition->Fill(((TParticle *) primaryList->At(closestPrimary))->Energy(),minDistance) ;
+ fhEMEnergy->Fill(gAlice->Particle(closestPrimary)->Energy(), recParticle->Energy() ) ;
+ fhEMPosition->Fill(gAlice->Particle(closestPrimary)->Energy(),minDistance) ;
fhPhotEM->Fill(CorrectEnergy(recParticle->Energy()) ) ;
fhPhotPPSD->Fill(CorrectEnergy(recParticle->Energy()) ) ;
}
break ;
case AliPHOSFastRecParticle::kNEUTRALEM:
if(primaryType == 22){
- fhEMEnergy->Fill(((TParticle *)primaryList->At(closestPrimary))->Energy(),recParticle->Energy() ) ;
- fhEMPosition->Fill(((TParticle *)primaryList->At(closestPrimary))->Energy(),minDistance ) ;
+ fhEMEnergy->Fill(gAlice->Particle(closestPrimary)->Energy(),recParticle->Energy() ) ;
+ fhEMPosition->Fill(gAlice->Particle(closestPrimary)->Energy(),minDistance ) ;
fhPhotNuEM->Fill(CorrectEnergy(recParticle->Energy()) ) ;
fhPhotEM->Fill(CorrectEnergy(recParticle->Energy()) ) ;
case AliPHOSFastRecParticle::kGAMMAHA:
if(primaryType == 22){ //photon
fhPhotGaHa->Fill(CorrectEnergy(recParticle->Energy()) ) ;
- fhPPSDEnergy->Fill(((TParticle *) primaryList->At(closestPrimary))->Energy(), recParticle->Energy() ) ;
- fhPPSDPosition->Fill(((TParticle *) primaryList->At(closestPrimary))->Energy(),minDistance) ;
+ fhPPSDEnergy->Fill(gAlice->Particle(closestPrimary)->Energy(), recParticle->Energy() ) ;
+ fhPPSDPosition->Fill(gAlice->Particle(closestPrimary)->Energy(),minDistance) ;
fhPhotPPSD->Fill(CorrectEnergy(recParticle->Energy()) ) ;
}
if(primaryType == 2112){ //neutron
/*
$Log$
+ Revision 1.5 2000/11/30 11:58:21 schutz
+ make it compile with Federico modifications
+
Revision 1.4 2000/11/20 09:50:03 schutz
AliPHOSCPVHit inherits from AliHit
// --- ROOT system ---
#include <TTree.h>
+#include <TFile.h>
// --- Standard library ---
#include <stdio.h>
//______________________________________________________________________________
-void AliPHOSCPVModule::MakeBranch(char *title,Int_t i)
+void AliPHOSCPVModule::MakeBranch(char *title,Int_t i,char *file)
{
//
// Create a new branch for a EMC or CPV module #i in the current Root Tree
char branchname[10];
sprintf(branchname,"%s%d",title,i);
- gAlice->TreeH()->Branch(branchname,&fHits, 1000);
+ gAlice->MakeBranchInTree(gAlice->TreeH(),
+ branchname, &fHits, 1000, file) ;
}
//_____________________________________________________________________________
void Clear(Option_t *opt="");
void Print(Option_t *opt="");
void AddHit(Int_t shunt, Int_t track, TLorentzVector p, Float_t *xy, Int_t ipart);
- void MakeBranch (char *title, Int_t i);
+ void MakeBranch (char *title, Int_t i, char *file=0);
void SetTreeAddress(char *title, Int_t i);
TClonesArray *Hits (void) {return fHits;}
// --- ROOT system ---
#include "TClonesArray.h"
+class TFile;
+
// --- AliRoot header files ---
#include "AliPHOS.h"
#include "AliPHOSGeometry.h"
gAlice->TreeD()->Write(0,TObject::kOverwrite) ;
}
+
//___________________________________________________________________________
-void AliPHOSv1::MakeBranch(Option_t* opt)
+void AliPHOSv1::MakeBranch(Option_t* opt, char *file)
{
// Create new branche in the current Root Tree in the digit Tree
AliDetector::MakeBranch(opt) ;
// Create new branches EMC<i> for hits in EMC modules
- for( Int_t i=0; i<fGeom->GetNModules(); i++ ) GetEMCModule(i).MakeBranch("EMC",i+1);
+ for( Int_t i=0; i<fGeom->GetNModules(); i++ ) GetEMCModule(i).MakeBranch("EMC",i+1,file);
// Create new branches CPV<i> for hits in CPV modules for IHEP geometry
if ( strcmp(fGeom->GetName(),"IHEP") == 0 || strcmp(fGeom->GetName(),"MIXT") == 0 ) {
- for( Int_t i=0; i<fGeom->GetNCPVModules(); i++ ) GetCPVModule(i).MakeBranch("CPV",i+1);
+ for( Int_t i=0; i<fGeom->GetNCPVModules(); i++ ) GetCPVModule(i).MakeBranch("CPV",i+1,file);
}
}
// --- ROOT system ---
#include "TClonesArray.h"
+class TFile;
+
// --- AliRoot header files ---
#include "AliPHOSv0.h"
#include "AliPHOSGeometry.h"
// Gives the version number
return 1 ;
}
- virtual void MakeBranch(Option_t* opt) ;
+ virtual void MakeBranch(Option_t* opt, char *file=0 ) ;
void Reconstruction(AliPHOSReconstructioner * Reconstructioner) ;
void ResetClusters(){} ;
virtual void ResetHits() ;
return *this ;
}
+ // IHEP's CPV specific functions
+
AliPHOSCPVModule &GetEMCModule(int n) { return *(AliPHOSCPVModule*)fEMCModules->operator[](n); }
AliPHOSCPVModule &GetCPVModule(int n) { return *(AliPHOSCPVModule*)fCPVModules->operator[](n); }
#include "TParticle.h"
#include "TTree.h"
#include "TGeometry.h"
+#include "TFile.h"
// --- Standard library ---
}
//___________________________________________________________________________
-void AliPHOSv4::MakeBranch(Option_t* opt)
+void AliPHOSv4::MakeBranch(Option_t* opt, char *file)
{
// Create new branch in the current reconstructed Root Tree
- AliDetector::MakeBranch(opt) ;
+ AliDetector::MakeBranch(opt,file) ;
char branchname[10];
sprintf(branchname,"%s",GetName());
char *cd = strstr(opt,"R");
if (fFastRecParticles && gAlice->TreeR() && cd) {
- gAlice->TreeR()->Branch(branchname, &fFastRecParticles, fBufferSize);
+ gAlice->MakeBranchInTree(gAlice->TreeR(),
+ branchname, &fFastRecParticles, fBufferSize, file) ;
}
}
#include "TClonesArray.h"
#include "TRandom.h"
+class TFile;
+
// --- AliRoot header files ---
#include "AliPHOS.h"
#include "AliPHOSGeometry.h"
return 4 ;
}
- void MakeBranch(Option_t* opt) ;
+ void MakeBranch(Option_t* opt, char *file=0) ;
Double_t MakeEnergy(const Double_t energy) ; // makes the detected energy
TVector3 MakePosition(const Double_t energy, const TVector3 pos, const Double_t th, const Double_t ph) ;
// makes the detected position
}
//___________________________________________________________________________
-void AliPHOSvFast::MakeBranch(Option_t* opt)
+void AliPHOSvFast::MakeBranch(Option_t* opt, char *file)
{
// Create new branch in the current reconstructed Root Tree
- AliDetector::MakeBranch(opt) ;
+ AliDetector::MakeBranch(opt,file) ;
char branchname[10];
sprintf(branchname,"%s",GetName());
char *cd = strstr(opt,"R");
if (fFastRecParticles && gAlice->TreeR() && cd) {
- gAlice->TreeR()->Branch(branchname, &fFastRecParticles, fBufferSize);
+ gAlice->MakeBranchInTree(gAlice->TreeR(),
+ branchname, &fFastRecParticles, fBufferSize, file);
}
}
virtual AliPHOSGeometry * GetGeometry() { return fGeom ; }
virtual void Init(void) ; // does nothing
Int_t IsVersion(void) const { return -1 ; }
- void MakeBranch(Option_t* opt) ;
+ void MakeBranch(Option_t* opt, char *file=0) ;
Double_t MakeEnergy(const Double_t energy) ; // makes the detected energy
TVector3 MakePosition(const Double_t energy, const TVector3 pos, const Double_t th, const Double_t ph) ;
// makes the detected position
#pragma link off all classes;
#pragma link off all functions;
-#pragma link C++ class AliPHOS ;
-#pragma link C++ class AliPHOSClusterizer ;
-#pragma link C++ class AliPHOSClusterizerv1 ;
-#pragma link C++ class AliPHOSCpvRecPoint ;
-#pragma link C++ class AliPHOSDigit ;
-#pragma link C++ class AliPHOSEmcRecPoint ;
-#pragma link C++ class AliPHOSFastRecParticle ;
-#pragma link C++ class AliPHOSGeometry ;
-#pragma link C++ class AliPHOSHit ;
-#pragma link C++ class AliPHOSIndexToObject ;
-#pragma link C++ class AliPHOSLink ;
-#pragma link C++ class AliPHOSPpsdRecPoint ;
-#pragma link C++ class AliPHOSReconstructioner ;
-#pragma link C++ class AliPHOSRecPoint ;
-#pragma link C++ class AliPHOSv0 ;
-#pragma link C++ class AliPHOSv1 ;
-#pragma link C++ class AliPHOSv2 ;
-#pragma link C++ class AliPHOSv3 ;
-#pragma link C++ class AliPHOSv4 ;
-#pragma link C++ class AliPHOSTrackSegment ;
-#pragma link C++ class AliPHOSTrackSegmentMaker ;
-#pragma link C++ class AliPHOSTrackSegmentMakerv1 ;
-#pragma link C++ class AliPHOSRecParticle ;
-#pragma link C++ class AliPHOSPID ;
-#pragma link C++ class AliPHOSPIDv1 ;
-#pragma link C++ class AliPHOSAnalyze ;
-#pragma link C++ class AliPHOSEMCAGeometry ;
-#pragma link C++ class AliPHOSCPVBaseGeometry ;
-#pragma link C++ class AliPHOSCPVGeometry ;
-#pragma link C++ class AliPHOSPPSDGeometry ;
-#pragma link C++ class AliPHOSSupportGeometry ;
-#pragma link C++ class AliPHOSCPVModule ;
-#pragma link C++ class AliPHOSCPVHit ;
-#pragma link C++ class AliPHOSCPVDigit ;
+#pragma link C++ class AliPHOS+;
+#pragma link C++ class AliPHOSClusterizer+;
+#pragma link C++ class AliPHOSClusterizerv1+;
+#pragma link C++ class AliPHOSCpvRecPoint+;
+#pragma link C++ class AliPHOSDigit+;
+#pragma link C++ class AliPHOSEmcRecPoint+;
+#pragma link C++ class AliPHOSFastRecParticle+;
+#pragma link C++ class AliPHOSGeometry+;
+#pragma link C++ class AliPHOSHit+;
+#pragma link C++ class AliPHOSIndexToObject+;
+#pragma link C++ class AliPHOSLink+;
+#pragma link C++ class AliPHOSPpsdRecPoint+;
+#pragma link C++ class AliPHOSReconstructioner+;
+#pragma link C++ class AliPHOSRecPoint+;
+#pragma link C++ class AliPHOSv0+;
+#pragma link C++ class AliPHOSv1+;
+#pragma link C++ class AliPHOSv2+;
+#pragma link C++ class AliPHOSv3+;
+#pragma link C++ class AliPHOSv4+;
+#pragma link C++ class AliPHOSTrackSegment+;
+#pragma link C++ class AliPHOSTrackSegmentMaker+;
+#pragma link C++ class AliPHOSTrackSegmentMakerv1+;
+#pragma link C++ class AliPHOSRecParticle+;
+#pragma link C++ class AliPHOSPID+;
+#pragma link C++ class AliPHOSPIDv1+;
+#pragma link C++ class AliPHOSAnalyze+;
+#pragma link C++ class AliPHOSEMCAGeometry+;
+#pragma link C++ class AliPHOSCPVBaseGeometry+;
+#pragma link C++ class AliPHOSCPVGeometry+;
+#pragma link C++ class AliPHOSPPSDGeometry+;
+#pragma link C++ class AliPHOSSupportGeometry+;
+#pragma link C++ class AliPHOSCPVModule+;
+#pragma link C++ class AliPHOSCPVHit+;
+#pragma link C++ class AliPHOSCPVDigit+;
#endif
/*
$Log$
+Revision 1.12 2000/12/04 08:48:18 alibrary
+Fixing problems in the HEAD
+
Revision 1.11 2000/11/17 10:15:24 morsch
Call to AliDetector::ResetHits() added to method AliPMD::ResetHits()
#include <TTree.h>
#include <TGeometry.h>
#include <TClonesArray.h>
+#include <TFile.h>
#include "AliPMD.h"
#include "AliRun.h"
// Always make the TClonesArray, otherwise the automatic streamer gets angry
fRecPoints = new TClonesArray("AliPMDRecPoint",10000);
+
}
//_____________________________________________________________________________
new(lrecpoints[fNRecPoints++]) AliPMDRecPoint(p);
}
-void AliPMD::MakeBranch(Option_t* option)
+void AliPMD::MakeBranch(Option_t* option, char *file)
{
// Create Tree branches for the PMD
- printf("Make Branch - TreeR address %p\n",gAlice->TreeR());
- const Int_t kBufferSize = 4000;
- char branchname[30];
-
- AliDetector::MakeBranch(option);
+ char *cR = strstr(option,"R");
+
+ AliDetector::MakeBranch(option,file);
- sprintf(branchname,"%sRecPoints",GetName());
- if (fRecPoints && gAlice->TreeR()) {
- gAlice->TreeR()->Branch(branchname, &fRecPoints, kBufferSize);
- printf("Making Branch %s for reconstructed hits\n",branchname);
- }
+ if (cR) {
+ printf("Make Branch - TreeR address %p\n",gAlice->TreeR());
+
+ const Int_t kBufferSize = 4000;
+ char branchname[30];
+
+ sprintf(branchname,"%sRecPoints",GetName());
+ if (fRecPoints && gAlice->TreeR()) {
+ gAlice->MakeBranchInTree(gAlice->TreeR(),
+ branchname, &fRecPoints, kBufferSize, file) ;
+ }
+ }
}
#include "AliHit.h"
class TClonesArray;
+class TFile;
class AliPMDRecPoint;
class AliPMD : public AliDetector {
virtual void SetPadSize(Float_t, Float_t, Float_t, Float_t);
virtual void StepManager();
virtual void AddRecPoint(const AliPMDRecPoint &p);
- virtual void MakeBranch(Option_t* option);
+ virtual void MakeBranch(Option_t* option, char *file=0);
virtual void SetTreeAddress();
virtual void ResetHits();
#pragma link off all classes;
#pragma link off all functions;
-#pragma link C++ class AliPMD;
-#pragma link C++ class AliPMDv0;
-#pragma link C++ class AliPMDv1;
-#pragma link C++ class AliPMDv2;
-#pragma link C++ class AliPMDhit;
-#pragma link C++ class AliPMDRecPoint;
+#pragma link C++ class AliPMD+;
+#pragma link C++ class AliPMDv0+;
+#pragma link C++ class AliPMDv1+;
+#pragma link C++ class AliPMDv2+;
+#pragma link C++ class AliPMDhit+;
+#pragma link C++ class AliPMDRecPoint+;
#endif
#pragma link off all classes;
#pragma link off all functions;
- #pragma link C++ class AliMath;
- #pragma link C++ class AliSample;
- #pragma link C++ class AliRandom;
- #pragma link C++ class Ali3Vector;
- #pragma link C++ class Ali3VectorObj;
- #pragma link C++ class Ali4Vector;
- #pragma link C++ class Ali4VectorObj;
- #pragma link C++ class AliBoost;
- #pragma link C++ class AliPosition;
- #pragma link C++ class AliPositionObj;
- #pragma link C++ class AliSignal;
- #pragma link C++ class AliCalorimeter;
- #pragma link C++ class AliCalmodule;
- #pragma link C++ class AliCalcluster;
- #pragma link C++ class AliTrack;
- #pragma link C++ class AliJet;
- #pragma link C++ class AliVertex;
- #pragma link C++ class AliInvmass;
+ #pragma link C++ class AliMath+;
+ #pragma link C++ class AliSample+;
+ #pragma link C++ class AliRandom+;
+ #pragma link C++ class Ali3Vector+;
+ #pragma link C++ class Ali3VectorObj+;
+ #pragma link C++ class Ali4Vector+;
+ #pragma link C++ class Ali4VectorObj+;
+ #pragma link C++ class AliBoost+;
+ #pragma link C++ class AliPosition+;
+ #pragma link C++ class AliPositionObj+;
+ #pragma link C++ class AliSignal+;
+ #pragma link C++ class AliCalorimeter+;
+ #pragma link C++ class AliCalmodule+;
+ #pragma link C++ class AliCalcluster+;
+ #pragma link C++ class AliTrack+;
+ #pragma link C++ class AliJet+;
+ #pragma link C++ class AliVertex+;
+ #pragma link C++ class AliInvmass+;
#endif
/*
$Log$
+ Revision 1.40 2001/01/24 20:58:03 jbarbosa
+ Enhanced BuildGeometry. Now the photocathodes are drawn.
+
Revision 1.39 2001/01/22 21:40:24 jbarbosa
Removing magic numbers
//printf ("Done for Cerenkov %d\n\n\n\n",fNcerenkovs);
}
//___________________________________________
+void AliRICH::SDigits2Digits()
+{
+
+//
+// Gennerate digits
+//
+ AliRICHChamber* iChamber;
+
+ printf("Generating tresholds...\n");
+
+ for(Int_t i=0;i<7;i++) {
+ iChamber = &(Chamber(i));
+ iChamber->GenerateTresholds();
+ }
+
+ int nparticles = gAlice->GetNtrack();
+ cout << "RICH: Particles :" <<nparticles<<endl;
+ if (nparticles > 0) Digitise(0,0);
+}
+//___________________________________________
void AliRICH::AddPadHit(Int_t *clhits)
{
}
//___________________________________________
-void AliRICH::MakeBranch(Option_t* option)
+void AliRICH::MakeBranch(Option_t* option, char *file)
{
// Create Tree branches for the RICH.
const Int_t kBufferSize = 4000;
char branchname[20];
-
-
- AliDetector::MakeBranch(option);
- sprintf(branchname,"%sCerenkov",GetName());
- if (fCerenkovs && gAlice->TreeH()) {
- gAlice->TreeH()->Branch(branchname,&fCerenkovs, kBufferSize);
- printf("Making Branch %s for Cerenkov Hits\n",branchname);
- }
-
- sprintf(branchname,"%sPadHits",GetName());
- if (fPadHits && gAlice->TreeH()) {
- gAlice->TreeH()->Branch(branchname,&fPadHits, kBufferSize);
- printf("Making Branch %s for PadHits\n",branchname);
+
+ AliDetector::MakeBranch(option,file);
+
+ char *cH = strstr(option,"H");
+ char *cD = strstr(option,"D");
+ char *cR = strstr(option,"R");
+
+ if (cH) {
+ sprintf(branchname,"%sCerenkov",GetName());
+ if (fCerenkovs && gAlice->TreeH()) {
+ gAlice->MakeBranchInTree(gAlice->TreeH(),
+ branchname, &fCerenkovs, kBufferSize, file) ;
+ }
+ sprintf(branchname,"%sPadHits",GetName());
+ if (fPadHits && gAlice->TreeH()) {
+ gAlice->MakeBranchInTree(gAlice->TreeH(),
+ branchname, &fPadHits, kBufferSize, file) ;
+ }
}
-// one branch for digits per chamber
- Int_t i;
-
- for (i=0; i<kNCH ;i++) {
- sprintf(branchname,"%sDigits%d",GetName(),i+1);
-
- if (fDchambers && gAlice->TreeD()) {
- gAlice->TreeD()->Branch(branchname,&((*fDchambers)[i]), kBufferSize);
- printf("Making Branch %s for digits in chamber %d\n",branchname,i+1);
- }
+ if (cD) {
+ //
+ // one branch for digits per chamber
+ //
+ Int_t i;
+
+ for (i=0; i<kNCH ;i++) {
+ sprintf(branchname,"%sDigits%d",GetName(),i+1);
+ if (fDchambers && gAlice->TreeD()) {
+ gAlice->MakeBranchInTree(gAlice->TreeD(),
+ branchname, &((*fDchambers)[i]), kBufferSize, file) ;
+ }
+ }
}
-// one branch for raw clusters per chamber
- for (i=0; i<kNCH ;i++) {
- sprintf(branchname,"%sRawClusters%d",GetName(),i+1);
-
- if (fRawClusters && gAlice->TreeR()) {
- gAlice->TreeR()->Branch(branchname,&((*fRawClusters)[i]), kBufferSize);
- printf("Making Branch %s for raw clusters in chamber %d\n",branchname,i+1);
+ if (cR) {
+ //
+ // one branch for raw clusters per chamber
+ //
+ Int_t i;
+
+ for (i=0; i<kNCH ;i++) {
+ sprintf(branchname,"%sRawClusters%d",GetName(),i+1);
+ if (fRawClusters && gAlice->TreeR()) {
+ gAlice->MakeBranchInTree(gAlice->TreeR(),
+ branchname, &((*fRawClusters)[i]), kBufferSize, file) ;
+ }
+ }
+ //
+ // one branch for rec hits per chamber
+ //
+ for (i=0; i<kNCH ;i++) {
+ sprintf(branchname,"%sRecHits1D%d",GetName(),i+1);
+ if (fRecHits1D && gAlice->TreeR()) {
+ gAlice->MakeBranchInTree(gAlice->TreeR(),
+ branchname, &((*fRecHits1D)[i]), kBufferSize, file) ;
+ }
+ }
+ for (i=0; i<kNCH ;i++) {
+ sprintf(branchname,"%sRecHits3D%d",GetName(),i+1);
+ if (fRecHits3D && gAlice->TreeR()) {
+ gAlice->MakeBranchInTree(gAlice->TreeR(),
+ branchname, &((*fRecHits3D)[i]), kBufferSize, file) ;
}
- }
-
- // one branch for rec hits per chamber
- for (i=0; i<kNCH ;i++) {
- sprintf(branchname,"%sRecHits1D%d",GetName(),i+1);
-
- if (fRecHits1D && gAlice->TreeR()) {
- gAlice->TreeR()->Branch(branchname,&((*fRecHits1D)[i]), kBufferSize);
- printf("Making Branch %s for 1D rec. hits in chamber %d\n",branchname,i+1);
- }
- }
- for (i=0; i<kNCH ;i++) {
- sprintf(branchname,"%sRecHits3D%d",GetName(),i+1);
-
- if (fRecHits3D && gAlice->TreeR()) {
- gAlice->TreeR()->Branch(branchname,&((*fRecHits3D)[i]), kBufferSize);
- printf("Making Branch %s for 3D rec. hits in chamber %d\n",branchname,i+1);
- }
- }
-
+ }
+ }
}
//___________________________________________
// Reset number of digits and the digits array for this detector
//
for ( int i=0;i<kNCH;i++ ) {
- if ((*fDchambers)[i]) (*fDchambers)[i]->Clear();
+ if (fDchambers && (*fDchambers)[i]) (*fDchambers)[i]->Clear();
if (fNdch) fNdch[i]=0;
}
}
//gObjectTable->Print();
}
-
-//______________________________________________________________________________
-void AliRICH::Streamer(TBuffer &R__b)
-{
- // Stream an object of class AliRICH.
- AliRICHChamber *iChamber;
- AliSegmentation *segmentation;
- AliRICHResponse *response;
- TClonesArray *digitsaddress;
- TClonesArray *rawcladdress;
- TClonesArray *rechitaddress1D;
- TClonesArray *rechitaddress3D;
-
- if (R__b.IsReading()) {
- Version_t R__v = R__b.ReadVersion(); if (R__v) { }
- AliDetector::Streamer(R__b);
- R__b >> fNPadHits;
- R__b >> fPadHits; // diff
- R__b >> fNcerenkovs;
- R__b >> fCerenkovs; // diff
- R__b >> fDchambers;
- R__b >> fRawClusters;
- R__b >> fRecHits1D; //diff
- R__b >> fRecHits3D; //diff
- R__b >> fDebugLevel; //diff
- R__b.ReadStaticArray(fNdch);
- R__b.ReadStaticArray(fNrawch);
- R__b.ReadStaticArray(fNrechits1D);
- R__b.ReadStaticArray(fNrechits3D);
-//
- R__b >> fChambers;
-// Stream chamber related information
- for (Int_t i =0; i<kNCH; i++) {
- iChamber=(AliRICHChamber*) (*fChambers)[i];
- iChamber->Streamer(R__b);
- segmentation=iChamber->GetSegmentationModel();
- segmentation->Streamer(R__b);
- response=iChamber->GetResponseModel();
- response->Streamer(R__b);
- rawcladdress=(TClonesArray*) (*fRawClusters)[i];
- rawcladdress->Streamer(R__b);
- rechitaddress1D=(TClonesArray*) (*fRecHits1D)[i];
- rechitaddress1D->Streamer(R__b);
- rechitaddress3D=(TClonesArray*) (*fRecHits3D)[i];
- rechitaddress3D->Streamer(R__b);
- digitsaddress=(TClonesArray*) (*fDchambers)[i];
- digitsaddress->Streamer(R__b);
- }
- R__b >> fDebugLevel;
- R__b >> fCkovNumber;
- R__b >> fCkovQuarz;
- R__b >> fCkovGap;
- R__b >> fCkovCsi;
- R__b >> fLostRfreo;
- R__b >> fLostRquar;
- R__b >> fLostAfreo;
- R__b >> fLostAquarz;
- R__b >> fLostAmeta;
- R__b >> fLostCsi;
- R__b >> fLostWires;
- R__b >> fFreonProd;
- R__b >> fMipx;
- R__b >> fMipy;
- R__b >> fFeedbacks;
- R__b >> fLostFresnel;
-
- } else {
- R__b.WriteVersion(AliRICH::IsA());
- AliDetector::Streamer(R__b);
- R__b << fNPadHits;
- R__b << fPadHits; // diff
- R__b << fNcerenkovs;
- R__b << fCerenkovs; // diff
- R__b << fDchambers;
- R__b << fRawClusters;
- R__b << fRecHits1D; //diff
- R__b << fRecHits3D; //diff
- R__b << fDebugLevel; //diff
- R__b.WriteArray(fNdch, kNCH);
- R__b.WriteArray(fNrawch, kNCH);
- R__b.WriteArray(fNrechits1D, kNCH);
- R__b.WriteArray(fNrechits3D, kNCH);
-//
- R__b << fChambers;
-// Stream chamber related information
- for (Int_t i =0; i<kNCH; i++) {
- iChamber=(AliRICHChamber*) (*fChambers)[i];
- iChamber->Streamer(R__b);
- segmentation=iChamber->GetSegmentationModel();
- segmentation->Streamer(R__b);
- response=iChamber->GetResponseModel();
- response->Streamer(R__b);
- rawcladdress=(TClonesArray*) (*fRawClusters)[i];
- rawcladdress->Streamer(R__b);
- rechitaddress1D=(TClonesArray*) (*fRecHits1D)[i];
- rechitaddress1D->Streamer(R__b);
- rechitaddress3D=(TClonesArray*) (*fRecHits3D)[i];
- rechitaddress3D->Streamer(R__b);
- digitsaddress=(TClonesArray*) (*fDchambers)[i];
- digitsaddress->Streamer(R__b);
- }
- R__b << fDebugLevel;
- R__b << fCkovNumber;
- R__b << fCkovQuarz;
- R__b << fCkovGap;
- R__b << fCkovCsi;
- R__b << fLostRfreo;
- R__b << fLostRquar;
- R__b << fLostAfreo;
- R__b << fLostAquarz;
- R__b << fLostAmeta;
- R__b << fLostCsi;
- R__b << fLostWires;
- R__b << fFreonProd;
- R__b << fMipx;
- R__b << fMipy;
- R__b << fFeedbacks;
- R__b << fLostFresnel;
- }
-}
AliRICHPadHit* AliRICH::FirstPad(AliRICHHit* hit,TClonesArray *clusters )
{
//
#include "AliRICHChamber.h"
static const int kNCH=7;
+class TFile;
class AliRICHHit;
class AliRICHPadHit;
//
TClonesArray *PadHits() {return fPadHits;}
TClonesArray *Cerenkovs() {return fCerenkovs;}
- virtual void MakeBranch(Option_t *opt=" ");
+ virtual void MakeBranch(Option_t *opt=" ", char *file=0);
void SetTreeAddress();
virtual void ResetHits();
virtual void ResetDigits();
virtual void ResetRecHits3D();
virtual void FindClusters(Int_t nev,Int_t lastEntry);
virtual void Digitise(Int_t nev,Int_t flag,Option_t *opt=" ",Text_t *name=" ");
+ virtual void SDigits2Digits();
//
// Configuration Methods (per station id)
//
TObjArray *fDchambers; // List of digits
TClonesArray *fCerenkovs; // List of cerenkovs
Int_t fNdch[kNCH]; // Number of digits
- Text_t *fFileName; // Filename for event mixing
+ Text_t *fFileName; //! Filename for event mixing
TObjArray *fRawClusters; // List of raw clusters
TObjArray *fRecHits1D; // List of rec. hits
TObjArray *fRecHits3D; // List of rec. hits
/*
$Log$
+ Revision 1.8 2000/11/02 09:11:12 jbarbosa
+ Removed AliRICHRecHit.h from include.
+
Revision 1.7 2000/10/03 21:44:09 morsch
Use AliSegmentation and AliHit abstract base classes.
return *this;
}
-
-//______________________________________________________________________________
-void AliRICHClusterFinder::Streamer(TBuffer &R__b)
-{
- // Stream an object of class AliRICHClusterFinder.
-
- if (R__b.IsReading()) {
- Version_t R__v = R__b.ReadVersion(); if (R__v) { }
- TObject::Streamer(R__b);
- R__b >> fSegmentation;
- R__b >> fResponse;
- R__b >> fRawClusters;
- R__b >> fHitMap;
- R__b >> fCogCorr;
- R__b >> fDigits;
- R__b >> fNdigits;
- R__b >> fChamber;
- R__b >> fNRawClusters;
- R__b >> fNperMax;
- R__b >> fDeclusterFlag;
- R__b >> fClusterSize;
- R__b >> fNPeaks;
- } else {
- R__b.WriteVersion(AliRICHClusterFinder::IsA());
- TObject::Streamer(R__b);
- R__b << fSegmentation;
- R__b << fResponse;
- R__b << fRawClusters;
- R__b << fHitMap;
- R__b << fCogCorr;
- R__b << fDigits;
- R__b << fNdigits;
- R__b << fChamber;
- R__b << fNRawClusters;
- R__b << fNperMax;
- R__b << fDeclusterFlag;
- R__b << fClusterSize;
- R__b << fNPeaks;
- }
-}
/*
$Log$
+ Revision 1.7 2000/11/02 09:10:57 jbarbosa
+ Removed AliRICHRecHit.h from include.
+
Revision 1.6 2000/10/03 21:44:09 morsch
Use AliSegmentation and AliHit abstract base classes.
//
// Returns pointer to particle index in AliRun::fParticles
//
- TClonesArray *particles = gAlice->Particles();
- Int_t nparticles = particles->GetEntriesFast();
- if (fIndex < 0 || fIndex >= nparticles) return 0;
- return (TParticle*)particles->UncheckedAt(fIndex);
+ if (fIndex < 0 || fIndex >= gAlice->GetNtrack()) return 0;
+ return gAlice->Particle(fIndex);
}
//_____________________________________________________________________________
if (marker)
marker->Draw();
}
- TClonesArray *particles=gAlice->Particles();
- TParticle *p = (TParticle*)particles->UncheckedAt(fIndex);
+ TParticle *p = gAlice->Particle(fIndex);
printf("\nTrack index %d\n",fTrackIndex);
printf("Particle ID %d\n",p->GetPdgCode());
printf("Parent %d\n",p->GetFirstMother());
public:
AliRICHTresholdMap(AliSegmentation *seg);
- //AliRICHTresholdMap() {}
+ AliRICHTresholdMap() {fSegmentation = 0; fHitMap=0;}
virtual ~AliRICHTresholdMap();
virtual void FillHits();
virtual void Clear(const char *opt = "");
#pragma link off all classes;
#pragma link off all functions;
//#pragma link C++ enum Response_t;
-#pragma link C++ class AliRICH-;
-#pragma link C++ class AliRICHv0;
-#pragma link C++ class AliRICHv1;
-#pragma link C++ class AliRICHv2;
-#pragma link C++ class AliRICHHit;
-//#pragma link C++ class AliRICHPadHit;
-#pragma link C++ class AliRICHDigit;
-#pragma link C++ class AliRICHPadHit;
-#pragma link C++ class AliRICHTransientDigit;
-#pragma link C++ class AliRICHRawCluster;
-#pragma link C++ class AliRICHRecHit1D;
-#pragma link C++ class AliRICHRecHit3D;
-#pragma link C++ class AliRICHCerenkov;
-#pragma link C++ class AliRICHSegmentationV0;
-#pragma link C++ class AliRICHSegmentationV1;
-#pragma link C++ class AliRICHResponse;
-#pragma link C++ class AliRICHResponseV0;
-#pragma link C++ class AliRICHGeometry;
-#pragma link C++ class AliRICHChamber;
-#pragma link C++ class AliRICHPoints;
-#pragma link C++ class AliRICHDisplay;
-#pragma link C++ class AliRICHEllipse;
-#pragma link C++ class AliRICHDetect;
-#pragma link C++ class AliRICHHitMapA1;
-#pragma link C++ class AliRICHTresholdMap;
-#pragma link C++ class AliRICHClusterFinder-;
-#pragma link C++ class AliRICHPatRec;
+#pragma link C++ class AliRICH+;
+#pragma link C++ class AliRICHv0+;
+#pragma link C++ class AliRICHv1+;
+#pragma link C++ class AliRICHv2+;
+#pragma link C++ class AliRICHHit+;
+//#pragma link C++ class AliRICHPadHit+;
+#pragma link C++ class AliRICHDigit+;
+#pragma link C++ class AliRICHPadHit+;
+#pragma link C++ class AliRICHTransientDigit+;
+#pragma link C++ class AliRICHRawCluster+;
+#pragma link C++ class AliRICHRecHit1D+;
+#pragma link C++ class AliRICHRecHit3D+;
+#pragma link C++ class AliRICHCerenkov+;
+#pragma link C++ class AliRICHSegmentationV0+;
+#pragma link C++ class AliRICHSegmentationV1+;
+#pragma link C++ class AliRICHResponse+;
+#pragma link C++ class AliRICHResponseV0+;
+#pragma link C++ class AliRICHGeometry+;
+#pragma link C++ class AliRICHChamber+;
+#pragma link C++ class AliRICHPoints+;
+#pragma link C++ class AliRICHDisplay+;
+#pragma link C++ class AliRICHEllipse+;
+#pragma link C++ class AliRICHDetect+;
+#pragma link C++ class AliRICHHitMapA1+;
+#pragma link C++ class AliRICHTresholdMap+;
+#pragma link C++ class AliRICHClusterFinder+;
+#pragma link C++ class AliRICHPatRec+;
#endif
/*
$Log$
+Revision 1.16 2001/01/17 10:56:08 hristov
+Corrections to destructors
+
Revision 1.15 2001/01/01 13:10:42 hristov
Local definition of digits removed
#include "TNode.h"
#include "TRandom.h"
#include "TGeometry.h"
+#include "TFile.h"
#include "TParticle.h"
+
#include "AliRun.h"
#include "AliSTART.h"
#include "AliSTARTdigit.h"
}
//---------------------------------------------------------------------------
-void AliSTART::MakeBranch(Option_t* option)
+void AliSTART::MakeBranch(Option_t* option, char *file)
{
//
// Specific START branches
char branchname[10];
sprintf(branchname,"%s",GetName());
- AliDetector::MakeBranch(option);
+ AliDetector::MakeBranch(option,file);
- TTree *td = gAlice->TreeD();
- digits = new AliSTARTdigit();
- td->Branch(branchname,"AliSTARTdigit",&digits, buffersize);
- printf("Making Branch %s for digits\n",branchname);
-
+ char *cD = strstr(option,"D");
+
+ if (cD) {
+ digits = new AliSTARTdigit();
+ gAlice->MakeBranchInTree(gAlice->TreeD(),
+ branchname, "AliSTARTdigit", digits, buffersize, 1, file) ;
+ }
/*
- gAlice->TreeR()->Branch(branchname,"Int_t",&fZposit, buffersize);
- printf("Making Branch %s for vertex position %d\n",branchname);
+ char *cR = strstr(option,"R");
+
+ if (cR) {
+ gAlice->MakeBranchInTree(gAlice->TreeR(),
+ branchname, "Int_t", &fZposit, buffersize, 1, file) ;
+ }
*/
}
if (nparticles <= 0) return;
printf("\n nparticles %d\n",nparticles);
- TClonesArray *particles = gAlice->Particles();
sprintf(nameTH,"TreeH%d",evnum);
printf("%s\n",nameTH);
for (Int_t track=0; track<ntracks;track++) {
gAlice->ResetHits();
nbytes += th->GetEvent(track);
- particle=(TParticle*)particles->UncheckedAt(track);
+ particle=gAlice->Particle(track);
nhits =fHits->GetEntriesFast();
for (hit=0;hit<nhits;hit++) {
#include "AliDetector.h"
#include "TTree.h"
class TDirectory;
+class TFile;
+
R__EXTERN TDirectory * gDirectory;
virtual void Init();
void Hit2digit(Int_t iEventNum);
void Hit2digit(){return;}
- virtual void MakeBranch(Option_t *opt=" ");
+ virtual void MakeBranch(Option_t *opt=" ", char *file=0);
virtual void StepManager(){}
protected:
#pragma link off all classes;
#pragma link off all functions;
-#pragma link C++ class AliSTART;
-#pragma link C++ class AliSTARTv0;
-#pragma link C++ class AliSTARTv1;
-#pragma link C++ class AliSTARThit;
-#pragma link C++ class AliSTARTdigit;
-#pragma link C++ class AliSTARTvertex;
+#pragma link C++ class AliSTART+;
+#pragma link C++ class AliSTARTv0+;
+#pragma link C++ class AliSTARTv1+;
+#pragma link C++ class AliSTARThit+;
+#pragma link C++ class AliSTARTdigit+;
+#pragma link C++ class AliSTARTvertex+;
#endif
/*
$Log$
+Revision 1.10 2001/01/17 10:50:50 hristov
+Corrections to destructors
+
Revision 1.9 2000/12/12 18:19:06 alibrary
Introduce consistency check when loading points
#include <assert.h>
#include <TTree.h>
-#include "TBrowser.h"
+#include <TBrowser.h>
+#include <TFile.h>
#include "AliDetector.h"
#include "AliRun.h"
fDigits = 0;
fTimeGate = 200.e-9;
fBufferSize = 16000;
+ fDigitsFile = 0;
}
//_____________________________________________________________________________
fNdigits = 0;
fPoints = 0;
fBufferSize = 16000;
+ fDigitsFile = 0;
}
//_____________________________________________________________________________
delete fDigits;
fDigits = 0;
}
+ if (fDigitsFile) delete [] fDigitsFile;
}
//_____________________________________________________________________________
}
//_____________________________________________________________________________
-void AliDetector::MakeBranch(Option_t *option)
+void AliDetector::MakeBranch(Option_t *option, char *file)
{
//
// Create a new branch in the current Root Tree
// The branch of fHits is automatically split
//
+
char branchname[10];
sprintf(branchname,"%s",GetName());
//
// Get the pointer to the header
char *cH = strstr(option,"H");
//
- if (fHits && gAlice->TreeH() && cH) {
- gAlice->TreeH()->Branch(branchname,&fHits, fBufferSize);
- printf("* AliDetector::MakeBranch * Making Branch %s for hits\n",branchname);
+ if (fHits && gAlice->TreeH() && cH) {
+ gAlice->MakeBranchInTree(gAlice->TreeH(),
+ branchname, &fHits, fBufferSize, file) ;
}
+
+ char *cD = strstr(option,"D");
+
+ if (cD) {
+ if (file) {
+ fDigitsFile = new char[strlen (file)];
+ strcpy(fDigitsFile,file);
+ }
+ }
}
//_____________________________________________________________________________
}
}
-//_____________________________________________________________________________
-void AliDetector::Streamer(TBuffer &R__b)
-{
- //
- // Stream an object of class Detector.
- //
- if (R__b.IsReading()) {
- Version_t R__v = R__b.ReadVersion(); if (R__v) { }
- TNamed::Streamer(R__b);
- TAttLine::Streamer(R__b);
- TAttMarker::Streamer(R__b);
- AliModule::Streamer(R__b);
- R__b >> fTimeGate;
- R__b >> fIshunt;
- //R__b >> fNhits;
- //
- // Stream the pointers but not the TClonesArrays
- R__b >> fHits; // diff
- R__b >> fDigits; // diff
-
- } else {
- R__b.WriteVersion(AliDetector::IsA());
- TNamed::Streamer(R__b);
- TAttLine::Streamer(R__b);
- TAttMarker::Streamer(R__b);
- AliModule::Streamer(R__b);
- R__b << fTimeGate;
- R__b << fIshunt;
- //R__b << fNhits;
- //
- // Stream the pointers but not the TClonesArrays
- R__b << fHits; // diff
- R__b << fDigits; // diff
- }
-}
#include <AliModule.h>
class AliHit;
+class TTree;
class AliDetector : public AliModule {
virtual void Browse(TBrowser *b);
virtual void FinishRun();
virtual void LoadPoints(Int_t track);
- virtual void MakeBranch(Option_t *opt=" ");
+ virtual void MakeBranch(Option_t *opt=" ", char *file=0 );
virtual void ResetDigits();
virtual void ResetHits();
virtual void ResetPoints();
Float_t fTimeGate; //Time gate in seconds
Int_t fIshunt; //1 if the hit is attached to the primary
- Int_t fNhits; //Number of hits
- Int_t fNdigits; //Number of digits
- Int_t fBufferSize; //buffer size for Tree detector branches
+ Int_t fNhits; //!Number of hits
+ Int_t fNdigits; //!Number of digits
+ Int_t fBufferSize; //!buffer size for Tree detector branches
TClonesArray *fHits; //List of hits for one track only
TClonesArray *fDigits; //List of digits for this detector
- TObjArray *fPoints; //Array of points for each track (all tracks in memory)
+ char *fDigitsFile; //!File to store branches of digits tree for detector
+ TObjArray *fPoints; //!Array of points for each track (all tracks in memory)
ClassDef(AliDetector,1) //Base class for ALICE detectors
};
/*
$Log$
+Revision 1.13 2000/12/21 15:30:18 fca
+Correcting coding convention violations
+
Revision 1.12 2000/12/12 13:18:59 hristov
Protection against FPE
pm->Draw("same");
// fPad->Update();
// fPad->Modified();
- TClonesArray *particles=gAlice->Particles();
- TParticle *p = (TParticle*)particles->UncheckedAt(idx);
+ // TClonesArray *particles=gAlice->Particles();
+ // TParticle *p = (TParticle*)particles->UncheckedAt(idx);
+ TParticle *p = gAlice->Particle(idx);
printf("\nTrack index %d\n",idx);
printf("Particle ID %d\n",p->GetPdgCode());
printf("Parent %d\n",p->GetFirstMother());
/*
$Log$
+Revision 1.10 2000/12/21 15:30:18 fca
+Correcting coding convention violations
+
Revision 1.9 2000/10/04 10:08:01 fca
Correction of minor typing mistakes
//
// Default constructor
//
- printf("\n AliGenerator Default Constructor\n\n");
+ if (gAlice->GetDebug()>0)
+ printf("\n AliGenerator Default Constructor\n\n");
gAlice->SetGenerator(this);
SetThetaRange(); ResetBit(kThetaRange);
//
// Standard constructor
//
- printf("\n AliGenerator Constructor initializing number of particles \n\n");
+ if (gAlice->GetDebug()>0)
+ printf("\n AliGenerator Constructor initializing number of particles \n\n");
gAlice->SetGenerator(this);
SetThetaRange(); ResetBit(kThetaRange);
SetPhiRange(); ResetBit(kPhiRange);
/*
$Log$
+Revision 1.5 2000/07/12 08:56:25 fca
+Coding convention correction and warning removal
+
Revision 1.4 2000/07/11 18:24:59 fca
Coding convention corrections + few minor bug fixes
//
// Standard constructor
//
- TClonesArray &particles = *(gAlice->Particles());
if(shunt) {
int primary = gAlice->GetPrimary(track);
- ((TParticle *)particles[primary])->SetBit(kKeepBit);
+ gAlice->Particle(primary)->SetBit(kKeepBit);
fTrack=primary;
} else {
fTrack=track;
cc[10]=fC40; cc[11]=fC41; cc[12]=fC42; cc[13]=fC43; cc[14]=fC44;
}
-//____________________________________________________________________________
-void AliKalmanTrack::Streamer(TBuffer &R__b)
-{
- //-----------------------------------------------------
- // This is AliKalmanTrack streamer.
- //-----------------------------------------------------
- if (R__b.IsReading()) {
- Version_t R__v = R__b.ReadVersion(); if (R__v) { }
- TObject::Streamer(R__b);
- R__b >> fLab;
- R__b >> fP0;
- R__b >> fP1;
- R__b >> fP2;
- R__b >> fP3;
- R__b >> fP4;
- R__b >> fC00;
- R__b >> fC10;
- R__b >> fC11;
- R__b >> fC20;
- R__b >> fC21;
- R__b >> fC22;
- R__b >> fC30;
- R__b >> fC31;
- R__b >> fC32;
- R__b >> fC33;
- R__b >> fC40;
- R__b >> fC41;
- R__b >> fC42;
- R__b >> fC43;
- R__b >> fC44;
- R__b >> fChi2;
- R__b >> fN;
- } else {
- R__b.WriteVersion(AliKalmanTrack::IsA());
- TObject::Streamer(R__b);
- R__b << fLab;
- R__b << fP0;
- R__b << fP1;
- R__b << fP2;
- R__b << fP3;
- R__b << fP4;
- R__b << fC00;
- R__b << fC10;
- R__b << fC11;
- R__b << fC20;
- R__b << fC21;
- R__b << fC22;
- R__b << fC30;
- R__b << fC31;
- R__b << fC32;
- R__b << fC33;
- R__b << fC40;
- R__b << fC41;
- R__b << fC42;
- R__b << fC43;
- R__b << fC44;
- R__b << fChi2;
- R__b << fN;
- }
-}
/*
$Log$
+Revision 1.4 2001/01/17 10:50:50 hristov
+Corrections to destructors
+
Revision 1.3 2000/12/18 14:16:31 alibrary
HP compatibility fix
//
// Fill Global histograms first
//
- hist = (TH1F*) fQAHist->FindObject("hMCVcalls");
- hist->Fill(gMC->CurrentVolID(copy));
- hist = (TH1F*) fQAHist->FindObject("hMCMcalls");
- hist->Fill(id);
+
+
+ static TH1F* mcvcalls = (TH1F*) fQAHist->FindObject("hMCVcalls");
+ mcvcalls->Fill(gMC->CurrentVolID(copy));
+ static TH1F* mcmcalls = (TH1F*) fQAHist->FindObject("hMCMcalls");
+ mcmcalls->Fill(id);
+
//
// Now the step manager histograms
//
if(fOldId != id) {
- TLorentzVector p, x;
+ static Double_t mpi0=0;
+ static Double_t mpip=0;
+ static Double_t mpim=0;
+ static Double_t mep=0;
+ static Double_t mem=0;
+ Double_t mass=0;
+ Int_t num = gMC->TrackPid();
+
+ switch (num) {
+ case 111:
+ if (mpi0==0) mpi0=gAlice->PDGDB()->GetParticle(num)->Mass();
+ mass=mpi0;
+ break;
+ case 211:
+ if (mpip==0) mpip=gAlice->PDGDB()->GetParticle(num)->Mass();
+ mass=mpip;
+ break;
+ case -211:
+ if (mpim==0) mpim=gAlice->PDGDB()->GetParticle(num)->Mass();
+ mass=mpim;
+ break;
+ case 11:
+ if (mep==0) mep=gAlice->PDGDB()->GetParticle(num)->Mass();
+ mass=mep;
+ break;
+ case -11:
+ if (mem==0) mem=gAlice->PDGDB()->GetParticle(num)->Mass();
+ mass=mem;
+ break;
+ default:
+ mass =gAlice->PDGDB()->GetParticle(num)->Mass();
+ break;
+ }
+
+ static TLorentzVector p, x;
gMC->TrackMomentum(p);
gMC->TrackPosition(x);
- Double_t energy = TMath::Max(
- p[3]-gAlice->PDGDB()->GetParticle(gMC->TrackPid())->Mass(),1.e-12);
+ Double_t energy = TMath::Max(p[3]-mass,1.e-12);
if(fOldId > -1) {
if(!fDetDone[fOldId] && !gMC->IsNewTrack()) {
TList *histold = (TList*) (*fQAList)[fOldId];
/*
$Log$
+Revision 1.13 2000/11/30 07:12:49 alibrary
+Introducing new Rndm and QA classes
+
Revision 1.12 2000/10/02 21:28:14 fca
Removal of useless dependecies via forward declarations
Warning("ReadEuclidMedia","reading error or premature end of file\n");
}
-//_____________________________________________________________________________
-void AliModule::Streamer(TBuffer &R__b)
-{
- //
- // Stream an object of class Module.
- //
- if (R__b.IsReading()) {
- Version_t R__v = R__b.ReadVersion(); if (R__v) { }
- TNamed::Streamer(R__b);
- TAttLine::Streamer(R__b);
- TAttMarker::Streamer(R__b);
- fEuclidMaterial.Streamer(R__b);
- fEuclidGeometry.Streamer(R__b);
- R__b >> fActive;
- R__b >> fHistograms;
- //
- // Stream the pointers but not the TClonesArrays
- R__b >> fNodes; // diff
- } else {
- R__b.WriteVersion(AliModule::IsA());
- TNamed::Streamer(R__b);
- TAttLine::Streamer(R__b);
- TAttMarker::Streamer(R__b);
- fEuclidMaterial.Streamer(R__b);
- fEuclidGeometry.Streamer(R__b);
- R__b << fActive;
- R__b << fHistograms;
- //
- // Stream the pointers but not the TClonesArrays
- R__b << fNodes; // diff
- }
-}
class TClonesArray;
class TBrowser;
class TArrayI;
+class TFile;
class AliModule : public TNamed , public TAttLine, public TAttMarker,
public AliRndm {
Error("AddDigit","Digits cannot be added to module %s\n",fName.Data());}
virtual void AddHit(Int_t, Int_t*, Float_t *) {
Error("AddDigit","Hits cannot be added to module %s\n",fName.Data());}
+ virtual void Hits2SDigits() {}
+ virtual void SDigits2Digits() {}
+ virtual void Digits2Raw() {}
+ virtual void Raw2Digits() {}
virtual void Browse(TBrowser *) {}
virtual void CreateGeometry() {}
virtual void CreateMaterials() {}
//virtual void Hits2Digits() {}
virtual void Init() {}
virtual void LoadPoints(Int_t ) {}
- virtual void MakeBranch(Option_t *) {}
+ virtual void MakeBranch(Option_t *, char *file=0 ) {}
virtual void Paint(Option_t *) {}
virtual void ResetDigits() {}
+ virtual void ResetSDigits() {}
virtual void ResetHits() {}
virtual void ResetPoints() {}
virtual void SetTreeAddress() {}
protected:
// Data members
- TString fEuclidMaterial; //Name of the Euclid file for materials (if any)
- TString fEuclidGeometry; //Name of the Euclid file for geometry (if any)
+ TString fEuclidMaterial; //!Name of the Euclid file for materials (if any)
+ TString fEuclidGeometry; //!Name of the Euclid file for geometry (if any)
- TArrayI *fIdtmed; //List of tracking medium numbers
- TArrayI *fIdmate; //List of material numbers
- Int_t fLoMedium; //Minimum tracking medium ID for this Module
- Int_t fHiMedium; //Maximum tracking medium ID for this Module
+ TArrayI *fIdtmed; //!List of tracking medium numbers
+ TArrayI *fIdmate; //!List of material numbers
+ Int_t fLoMedium; //!Minimum tracking medium ID for this Module
+ Int_t fHiMedium; //!Maximum tracking medium ID for this Module
Bool_t fActive; //Detector activity flag
TList *fHistograms; //List of histograms
/*
$Log$
+Revision 1.6 2000/10/02 21:28:14 fca
+Removal of useless dependecies via forward declarations
+
Revision 1.5 2000/07/11 18:24:59 fca
Coding convention corrections + few minor bug fixes
//
// Returns pointer to particle index in AliRun::fParticles
//
- TClonesArray *particles = gAlice->Particles();
- Int_t nparticles = particles->GetEntriesFast();
- if (fIndex < 0 || fIndex >= nparticles) return 0;
- return (TParticle*)particles->UncheckedAt(fIndex);
+ if (fIndex < 0 || fIndex >= gAlice->GetNtrack()) return 0;
+ else return gAlice->Particle(fIndex);
}
//_____________________________________________________________________________
/*
$Log$
+Revision 1.48 2001/01/17 10:50:50 hristov
+Corrections to destructors
+
Revision 1.47 2000/12/18 10:44:01 morsch
Possibility to set field map by passing pointer to objet of type AliMagF via
SetField().
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
+#include <iostream.h>
#include <TFile.h>
#include <TRandom.h>
fTreeH = 0;
fTreeE = 0;
fTreeR = 0;
+ fTreeS = 0;
fParticles = 0;
fGeometry = 0;
fDisplay = 0;
fRandom = 0;
fMCQA = 0;
fTransParName = "\0";
+ fBaseFileName = "\0";
+ fParticleBuffer = 0;
+ fParticleMap = new TObjArray(10000);
}
//_____________________________________________________________________________
fTreeH = 0;
fTreeE = 0;
fTreeR = 0;
+ fTreeS = 0;
fTrRmax = 1.e10;
fTrZmax = 1.e10;
fGenerator = 0;
// Set random number generator
gRandom = fRandom = new TRandom3();
+
+ if (gSystem->Getenv("CONFIG_SEED")) {
+ gRandom->SetSeed((UInt_t)atoi(gSystem->Getenv("CONFIG_SEED")));
+ }
gROOT->GetListOfBrowsables()->Add(this,name);
//
fEvent = 0;
//
// Create the particle stack
- fParticles = new TClonesArray("TParticle",100);
+ fParticles = new TClonesArray("TParticle",1000);
fDisplay = 0;
//
fHitLists = new TList();
//
SetTransPar();
+ fBaseFileName = "\0";
+ fParticleBuffer = 0;
+ fParticleMap = new TObjArray(10000);
}
AliRun::~AliRun()
{
//
- // Defaullt AliRun destructor
+ // Default AliRun destructor
//
delete fImedia;
delete fField;
delete fTreeH;
delete fTreeE;
delete fTreeR;
+ delete fTreeS;
if (fModules) {
fModules->Delete();
delete fModules;
if (fTreeD) b->Add(fTreeD,fTreeD->GetName());
if (fTreeE) b->Add(fTreeE,fTreeE->GetName());
if (fTreeR) b->Add(fTreeR,fTreeR->GetName());
+ if (fTreeS) b->Add(fTreeS,fTreeS->GetName());
TIter next(fModules);
AliModule *detector;
// Clean Particles stack.
// Set parent/daughter relations
//
- TClonesArray &particles = *(gAlice->Particles());
+ TObjArray &particles = *fParticleMap;
TParticle *part;
int i;
- for(i=0; i<fNtrack; i++) {
- part = (TParticle *)particles.UncheckedAt(i);
- if(!part->TestBit(kDaughtersBit)) {
+ for(i=0; i<fHgwmk+1; i++) {
+ part = (TParticle *)particles.At(i);
+ if(part) if(!part->TestBit(kDaughtersBit)) {
part->SetFirstDaughter(-1);
part->SetLastDaughter(-1);
}
//
// Dumps particle i in the stack
//
- TClonesArray &particles = *fParticles;
- ((TParticle*) particles[i])->Print();
+ ((TParticle*) (*fParticleMap)[i])->Print();
}
//_____________________________________________________________________________
//
// Dumps the particle stack
//
- TClonesArray &particles = *fParticles;
+ TObjArray &particles = *fParticleMap;
printf(
"\n\n=======================================================================\n");
for (Int_t i=0;i<fNtrack;i++)
Warning("SetField","Invalid map %d\n",version);
}
}
-
-//_____________________________________________________________________________
-void AliRun::FillTree()
-{
- //
- // Fills all AliRun TTrees
- //
- if (fTreeK) fTreeK->Fill();
- if (fTreeH) fTreeH->Fill();
- if (fTreeD) fTreeD->Fill();
- if (fTreeR) fTreeR->Fill();
-}
//_____________________________________________________________________________
void AliRun::PreTrack()
// Write out the kinematics
if (fTreeK) {
CleanParents();
- fTreeK->Fill();
+ // fTreeK->Fill();
+ TObject *part;
+ for(i=0; i<fHgwmk+1; ++i) if((part=fParticleMap->At(i))) {
+ fParticleBuffer = (TParticle*) part;
+ fParticleFileMap[i]= (Int_t) fTreeK->GetEntries();
+ fTreeK->Fill();
+ (*fParticleMap)[i]=0;
+ } else printf("Why = 0 part # %d?\n",i);
}
// Write out the digits
fTreeD->Fill();
ResetDigits();
}
-
+
+ if (fTreeS) {
+ fTreeS->Fill();
+ ResetSDigits();
+ }
+
// Write out reconstructed clusters
if (fTreeR) {
fTreeR->Fill();
ResetStack();
// Write Tree headers
- // Int_t ievent = fHeader.GetEvent();
- // char hname[30];
- // sprintf(hname,"TreeK%d",ievent);
if (fTreeK) fTreeK->Write(0,TObject::kOverwrite);
- // sprintf(hname,"TreeH%d",ievent);
if (fTreeH) fTreeH->Write(0,TObject::kOverwrite);
- // sprintf(hname,"TreeD%d",ievent);
if (fTreeD) fTreeD->Write(0,TObject::kOverwrite);
- // sprintf(hname,"TreeR%d",ievent);
if (fTreeR) fTreeR->Write(0,TObject::kOverwrite);
-
+ if (fTreeS) fTreeS->Write(0,TObject::kOverwrite);
+
++fEvent;
}
//Output energy summary tables
EnergySummary();
-
- // file is retrieved from whatever tree
- TFile *file = 0;
- if (fTreeK) file = fTreeK->GetCurrentFile();
- if ((!file) && (fTreeH)) file = fTreeH->GetCurrentFile();
- if ((!file) && (fTreeD)) file = fTreeD->GetCurrentFile();
- if ((!file) && (fTreeE)) file = fTreeE->GetCurrentFile();
- if( NULL==file ) {
- Error("FinishRun","There isn't root file!");
- exit(1);
- }
+
+ TFile *file = fTreeE->GetCurrentFile();
+
file->cd();
+
fTreeE->Write(0,TObject::kOverwrite);
+ // Write AliRun info and all detectors parameters
+ Write();
+
// Clean tree information
if (fTreeK) {
delete fTreeK; fTreeK = 0;
if (fTreeE) {
delete fTreeE; fTreeE = 0;
}
-
- // Write AliRun info and all detectors parameters
- Write();
-
+
// Close output file
file->Write();
}
curr=track;
while(1) {
- particle=(TParticle*)fParticles->UncheckedAt(curr);
+ particle=(TParticle*)fParticleMap->At(curr);
// If the particle is flagged the three from here upward is saved already
if(particle->TestBit(kKeepBit)) return;
//
// Reset existing structures
- ResetStack();
+ // ResetStack();
ResetHits();
ResetDigits();
+ ResetSDigits();
// Delete Trees already connected
if (fTreeK) delete fTreeK;
if (fTreeH) delete fTreeH;
if (fTreeD) delete fTreeD;
if (fTreeR) delete fTreeR;
+ if (fTreeS) delete fTreeS;
// Get header from file
if(fTreeE) fTreeE->GetEntry(event);
else Error("GetEvent","Cannot file Header Tree\n");
+ TFile *file = fTreeE->GetCurrentFile();
+
+ file->cd();
// Get Kine Tree from file
char treeName[20];
sprintf(treeName,"TreeK%d",event);
fTreeK = (TTree*)gDirectory->Get(treeName);
- if (fTreeK) fTreeK->SetBranchAddress("Particles", &fParticles);
+ if (fTreeK) fTreeK->SetBranchAddress("Particles", &fParticleBuffer);
else Error("GetEvent","cannot find Kine Tree for event:%d\n",event);
+ // Create the particle stack
+ if(!fParticles) fParticles = new TClonesArray("TParticle",1000);
+ // Build the pointer list
+ if(fParticleMap) {
+ fParticleMap->Clear();
+ fParticleMap->Expand(fTreeK->GetEntries());
+ } else
+ fParticleMap = new TObjArray(fTreeK->GetEntries());
+ file->cd();
+
// Get Hits Tree header from file
sprintf(treeName,"TreeH%d",event);
fTreeH = (TTree*)gDirectory->Get(treeName);
Error("GetEvent","cannot find Hits Tree for event:%d\n",event);
}
+ file->cd();
+
// Get Digits Tree header from file
sprintf(treeName,"TreeD%d",event);
fTreeD = (TTree*)gDirectory->Get(treeName);
if (!fTreeD) {
- Warning("GetEvent","cannot find Digits Tree for event:%d\n",event);
+ // Warning("GetEvent","cannot find Digits Tree for event:%d\n",event);
}
+ file->cd();
// Get Reconstruct Tree header from file
sprintf(treeName,"TreeR%d",event);
if (!fTreeR) {
// printf("WARNING: cannot find Reconstructed Tree for event:%d\n",event);
}
+
+ file->cd();
// Set Trees branch addresses
TIter next(fModules);
detector->SetTreeAddress();
}
- if (fTreeK) fTreeK->GetEvent(0);
- fNtrack = Int_t (fParticles->GetEntries());
+ fNtrack = Int_t (fTreeK->GetEntries());
return fNtrack;
}
fCurrent=-1;
TParticle *track;
for(Int_t i=fNtrack-1; i>=0; i--) {
- track=(TParticle*) fParticles->UncheckedAt(i);
- if(!track->TestBit(kDoneBit)) {
+ track=(TParticle*) fParticleMap->At(i);
+ if(track) if(!track->TestBit(kDoneBit)) {
//
- // The track has not yet been processed
+ // The track exists and has not yet been processed
fCurrent=i;
ipart=track->GetPdgCode();
pmom[0]=track->Px();
if (fCurrent >= nprimaries) return;
if (fCurrent < nprimaries-1) {
fTimer.Stop();
- track=(TParticle*) fParticles->UncheckedAt(fCurrent+1);
+ track=(TParticle*) fParticleMap->At(fCurrent+1);
// track->SetProcessTime(fTimer.CpuTime());
}
fTimer.Start();
parent=track;
while (1) {
current=parent;
- part = (TParticle *)fParticles->UncheckedAt(current);
+ part = (TParticle *)fParticleMap->At(current);
parent=part->GetFirstMother();
if(parent<0) return current;
}
Warning("Init","Cannot initialise AliRun twice!\n");
return;
}
-
+
+ OpenBaseFile("recreate");
+
gROOT->LoadMacro(setup);
gInterpreter->ProcessLine(fConfigFunction.Data());
+
gMC->DefineParticles(); //Create standard MC particles
TObject *objfirst, *objlast;
fTransParName = filename;
}
+//____________________________________________________________________________
+void AliRun::SetBaseFile(char *filename)
+{
+ fBaseFileName = *filename;
+}
+
+//____________________________________________________________________________
+void AliRun::OpenBaseFile(const char *option)
+{
+ if(!strlen(fBaseFileName.Data())) {
+ const char *filename;
+ if ((filename=gSystem->Getenv("CONFIG_FILE"))) {
+ fBaseFileName=filename;
+ } else {
+ fBaseFileName="galice.root";
+ }
+ }
+ TFile *rootfile = new TFile(fBaseFileName.Data(),option);
+ rootfile->SetCompressionLevel(2);
+}
+
//____________________________________________________________________________
void AliRun::ReadTransPar()
{
}
//_____________________________________________________________________________
-void AliRun::MakeTree(Option_t *option)
+void AliRun::MakeBranchInTree(TTree *tree, const char* name, void* address, Int_t size, char *file)
+{
+ if (GetDebug()>1)
+ printf("* MakeBranch * Making Branch %s \n",name);
+
+ TBranch *branch = tree->Branch(name,address,size);
+
+ if (file) {
+ TDirectory *cwd = gDirectory;
+ branch->SetFile(file);
+ TIter next( branch->GetListOfBranches());
+ while ((branch=(TBranch*)next())) {
+ branch->SetFile(file);
+ }
+ if (GetDebug()>1)
+ printf("* MakeBranch * Diverting Branch %s to file %s\n",name,file);
+ cwd->cd();
+ }
+}
+
+//_____________________________________________________________________________
+void AliRun::MakeBranchInTree(TTree *tree, const char* name, const char *classname, void* address, Int_t size, Int_t splitlevel, char *file)
+{
+ TDirectory *cwd = gDirectory;
+ TBranch *branch = tree->Branch(name,classname,address,size,splitlevel);
+ if (GetDebug()>1)
+ printf("* MakeBranch * Making Branch %s \n",name);
+ if (file) {
+ branch->SetFile(file);
+ TIter next( branch->GetListOfBranches());
+ while ((branch=(TBranch*)next())) {
+ branch->SetFile(file);
+ }
+ if (GetDebug()>1)
+ printf("* MakeBranch * Diverting Branch %s to file %s\n",name,file);
+ cwd->cd();
+ }
+}
+//_____________________________________________________________________________
+void AliRun::MakeTree(Option_t *option, char *file)
{
//
// Create the ROOT trees
char *oE = strstr(option,"E");
char *oD = strstr(option,"D");
char *oR = strstr(option,"R");
+ char *oS = strstr(option,"S");
//
+
if (oK && !fTreeK) {
sprintf(hname,"TreeK%d",fEvent);
fTreeK = new TTree(hname,"Kinematics");
// Create a branch for particles
- fTreeK->Branch("Particles",&fParticles,4000);
+ MakeBranchInTree(fTreeK,
+ "Particles", "TParticle", &fParticleBuffer, 4000, 1, file) ;
fTreeK->Write();
}
if (oH && !fTreeH) {
fTreeD = new TTree(hname,"Digits");
fTreeD->Write();
}
+ if (oS && !fTreeS) {
+ sprintf(hname,"TreeS%d",fEvent);
+ fTreeS = new TTree(hname,"SDigits");
+ fTreeS->Write();
+ }
if (oR && !fTreeR) {
sprintf(hname,"TreeR%d",fEvent);
fTreeR = new TTree(hname,"Reconstruction");
if (oE && !fTreeE) {
fTreeE = new TTree("TE","Header");
// Create a branch for Header
- fTreeE->Branch("Header","AliHeader",&gAliHeader,4000);
+ MakeBranchInTree(fTreeE,
+ "Header", "AliHeader", &gAliHeader, 4000, 1, file) ;
fTreeE->Write();
}
+
//
// Create a branch for hits/digits for each detector
// Each branch is a TClonesArray. Each data member of the Hits classes
TIter next(fModules);
AliModule *detector;
while((detector = (AliModule*)next())) {
- if (oH || oD || oR) detector->MakeBranch(option);
+ if (oH || oR) detector->MakeBranch(option,file);
}
}
return fHgwmk;
}
+//_____________________________________________________________________________
+TParticle* AliRun::Particle(Int_t i)
+{
+ if(!(*fParticleMap)[i]) {
+ Int_t nentries = fParticles->GetEntries();
+ fTreeK->GetEntry(fParticleFileMap[i]);
+ new ((*fParticles)[nentries]) TParticle(*fParticleBuffer);
+ fParticleMap->AddAt((*fParticles)[nentries],i);
+ }
+ return (TParticle *) (*fParticleMap)[i];
+}
+
//_____________________________________________________________________________
void AliRun::PurifyKine()
{
// Compress kinematic tree keeping only flagged particles
// and renaming the particle id's in all the hits
//
- TClonesArray &particles = *fParticles;
+ // TClonesArray &particles = *fParticles;
+ TObjArray &particles = *fParticleMap;
int nkeep=fHgwmk+1, parent, i;
- TParticle *part, *partnew, *father;
- int *map = new int[particles.GetEntries()];
+ TParticle *part, *father;
+ TArrayI map(particles.GetLast()+1);
// Save in Header total number of tracks before compression
fHeader.SetNtrack(fHeader.GetNtrack()+fNtrack-fHgwmk);
+ // If no tracks generated return now
+ if(fHgwmk+1 == fNtrack) return;
+
+ Int_t toshrink = fNtrack-fHgwmk-1;
+
// First pass, invalid Daughter information
for(i=0; i<fNtrack; i++) {
// Preset map, to be removed later
- if(i<=fHgwmk) map[i]=i ; else map[i] = -99;
- ((TParticle *)particles.UncheckedAt(i))->ResetBit(kDaughtersBit);
+ if(i<=fHgwmk) map[i]=i ;
+ else {
+ map[i] = -99;
+ // particles.UncheckedAt(i)->ResetBit(kDaughtersBit);
+ if((part=(TParticle*) particles.At(i))) part->ResetBit(kDaughtersBit);
+ }
}
+ // Invalid daughter information for the parent of the first particle
+ // generated. This may or may not be the current primary according to
+ // whether decays have been recorded among the primaries
+ part = (TParticle *)particles.At(fHgwmk+1);
+ particles.At(part->GetFirstMother())->ResetBit(kDaughtersBit);
// Second pass, build map between old and new numbering
for(i=fHgwmk+1; i<fNtrack; i++) {
- part = (TParticle *)particles.UncheckedAt(i);
- if(part->TestBit(kKeepBit)) {
+ if(particles.At(i)->TestBit(kKeepBit)) {
// This particle has to be kept
map[i]=nkeep;
- if(i!=nkeep) {
-
- // Old and new are different, have to copy
- partnew = (TParticle *)particles.UncheckedAt(nkeep);
- // Change due to a bug in the HP compiler
- // *partnew = *part;
- memcpy(partnew,part,sizeof(TParticle));
- } else partnew = part;
+ // If old and new are different, have to move the pointer
+ if(i!=nkeep) particles[nkeep]=particles.At(i);
+ part = (TParticle*) particles.At(nkeep);
// as the parent is always *before*, it must be already
// in place. This is what we are checking anyway!
- if((parent=partnew->GetFirstMother())>fHgwmk) {
- if(map[parent]==-99) printf("map[%d] = -99!\n",parent);
- partnew->SetFirstMother(map[parent]);
- }
+ if((parent=part->GetFirstMother())>fHgwmk)
+ if(map[parent]==-99) Fatal("PurifyKine","map[%d] = -99!\n",parent);
+ else part->SetFirstMother(map[parent]);
+
nkeep++;
}
}
- fNtrack=nkeep;
// Fix daughters information
- for (i=0; i<fNtrack; i++) {
- part = (TParticle *)particles.UncheckedAt(i);
+ for (i=fHgwmk+1; i<nkeep; i++) {
+ part = (TParticle *)particles.At(i);
parent = part->GetFirstMother();
if(parent>=0) {
- father = (TParticle *)particles.UncheckedAt(parent);
+ father = (TParticle *)particles.At(parent);
if(father->TestBit(kDaughtersBit)) {
if(i<father->GetFirstDaughter()) father->SetFirstDaughter(i);
if(i>father->GetLastDaughter()) father->SetLastDaughter(i);
} else {
- // Iitialise daughters info for first pass
+ // Initialise daughters info for first pass
father->SetFirstDaughter(i);
father->SetLastDaughter(i);
father->SetBit(kDaughtersBit);
}
}
-#ifdef old
- // Now loop on all detectors and reset the hits
- AliHit *OneHit;
- TIter next(fModules);
- AliModule *detector;
- while((detector = (AliModule*)next())) {
- if (!detector->Hits()) continue;
- TClonesArray &vHits=*(detector->Hits());
- if(vHits.GetEntries() != detector->GetNhits())
- printf("vHits.GetEntries()!=detector->GetNhits(): %d != %d\n",
- vHits.GetEntries(),detector->GetNhits());
- for (i=0; i<detector->GetNhits(); i++) {
- OneHit = (AliHit *)vHits.UncheckedAt(i);
- OneHit->SetTrack(map[OneHit->GetTrack()]);
- }
- }
-#else
-
// Now loop on all registered hit lists
TIter next(fHitLists);
TCollection *hitList;
hit->SetTrack(map[hit->GetTrack()]);
}
}
-#endif
//
// This for detectors which have a special mapping mechanism
TIter nextmod(fModules);
AliModule *detector;
while((detector = (AliModule*)nextmod())) {
- detector->RemapTrackHitIDs(map);
+ detector->RemapTrackHitIDs(map.GetArray());
}
+ // Now the output bit, from fHgwmk to nkeep we write everything and we erase
+ if(nkeep>fParticleFileMap.GetSize()) fParticleFileMap.Set(Int_t (nkeep*1.5));
+
- fHgwmk=nkeep-1;
- particles.SetLast(fHgwmk);
- delete [] map;
+ for (i=fHgwmk+1; i<nkeep; ++i) {
+ fParticleBuffer = (TParticle*) particles.At(i);
+ fParticleFileMap[i]=(Int_t) fTreeK->GetEntries();
+ fTreeK->Fill();
+ particles[i]=0;
+ }
+
+ for (i=nkeep; i<fNtrack; ++i) particles[i]=0;
+
+ fLoadPoint-=toshrink;
+ for(i=fLoadPoint; i<fLoadPoint+toshrink; ++i) fParticles->RemoveAt(i);
+
+ fNtrack=nkeep;
+ fHgwmk=nkeep-1;
+ // delete [] map;
}
//_____________________________________________________________________________
ResetStack();
ResetHits();
ResetDigits();
+ ResetSDigits();
// Initialise event header
fHeader.Reset(fRun,fEvent);
sprintf(hname,"TreeD%d",fEvent);
fTreeD->SetName(hname);
}
+ if(fTreeS) {
+ fTreeS->Reset();
+ sprintf(hname,"TreeS%d",fEvent);
+ fTreeS->SetName(hname);
+ }
if(fTreeR) {
fTreeR->Reset();
sprintf(hname,"TreeR%d",fEvent);
fTreeR->SetName(hname);
}
}
-
//_____________________________________________________________________________
void AliRun::ResetDigits()
{
}
}
+//_____________________________________________________________________________
+void AliRun::ResetSDigits()
+{
+ //
+ // Reset all Detectors digits
+ //
+ TIter next(fModules);
+ AliModule *detector;
+ while((detector = (AliModule*)next())) {
+ detector->ResetSDigits();
+ }
+}
+
//_____________________________________________________________________________
void AliRun::ResetHits()
{
if (!fInitDone) InitMC(setup);
// Create the Root Tree with one branch per detector
- MakeTree("KHDER");
+
+ if (gSystem->Getenv("CONFIG_SPLIT_FILE")) {
+ MakeTree("E");
+ MakeTree("K","Kine.root");
+ MakeTree("H","Hits.root");
+ MakeTree("R","Reco.root");
+ } else {
+ MakeTree("EKHR");
+ }
gMC->ProcessRun(nevent);
if(nevent>0) FinishRun();
}
+//_____________________________________________________________________________
+
+void AliRun::Hits2Digits(const char *selected)
+{
+ Hits2SDigits(selected);
+ SDigits2Digits(selected);
+}
+
+//_____________________________________________________________________________
+
+void AliRun::Hits2SDigits(const char *selected)
+{
+ //
+ // Main function to be called to convert hits to digits.
+
+ gAlice->GetEvent(0);
+
+ TObjArray *detectors = gAlice->Detectors();
+
+ TIter next(detectors);
+
+ AliDetector *detector;
+
+ TDirectory *cwd = gDirectory;
+
+ MakeTree("S");
+
+ while((detector = (AliDetector*)next())) {
+ if (selected) {
+ if (strcmp(detector->GetName(),selected)) continue;
+ }
+ if (detector->IsActive()){
+ if (gSystem->Getenv("CONFIG_SPLIT_FILE")) {
+ if (GetDebug()>0)
+ cout << "Processing " << detector->GetName() << "..." << endl;
+ char * outFile = new char[strlen (detector->GetName())+18];
+ sprintf(outFile,"SDigits.%s.root",detector->GetName());
+ detector->MakeBranch("S",outFile);
+ delete outFile;
+ } else {
+ detector->MakeBranch("S");
+ }
+ cwd->cd();
+ detector->Hits2SDigits();
+ }
+ }
+}
+
+//_____________________________________________________________________________
+
+void AliRun::SDigits2Digits(const char *selected)
+{
+ //
+ // Main function to be called to convert hits to digits.
+
+ gAlice->GetEvent(0);
+
+ TObjArray *detectors = gAlice->Detectors();
+
+ TIter next(detectors);
+
+ AliDetector *detector;
+
+ TDirectory *cwd = gDirectory;
+
+ MakeTree("D");
+
+ while((detector = (AliDetector*)next())) {
+ if (selected) {
+ if (strcmp(detector->GetName(),selected)) continue;
+ }
+ if (detector->IsActive()){
+ if (gSystem->Getenv("CONFIG_SPLIT_FILE")) {
+ if (GetDebug()>0)
+ cout << "Processing " << detector->GetName() << "..." << endl;
+ char * outFile = new char[strlen (detector->GetName())+16];
+ sprintf(outFile,"Digits.%s.root",detector->GetName());
+ detector->MakeBranch("D",outFile);
+ delete outFile;
+ } else {
+ detector->MakeBranch("D");
+ }
+ cwd->cd();
+ detector->SDigits2Digits();
+ }
+ }
+}
+
//_____________________________________________________________________________
void AliRun::RunLego(const char *setup, Int_t nc1, Float_t c1min,
Float_t c1max,Int_t nc2,Float_t c2min,Float_t c2max,
//printf("Loading particle %s mass %f ene %f No %d ip %d pos %f %f %f mom %f %f %f kS %d m %s\n",
//pname,mass,e,fNtrack,pdg,vpos[0],vpos[1],vpos[2],pmom[0],pmom[1],pmom[2],kS,mecha);
-
- particle=new(particles[fNtrack]) TParticle(pdg,kS,parent,-1,kfirstdaughter,
+
+ particle=new(particles[fLoadPoint++]) TParticle(pdg,kS,parent,-1,kfirstdaughter,
klastdaughter,pmom[0],pmom[1],pmom[2],
e,vpos[0],vpos[1],vpos[2],tof);
- ((TParticle*)particles[fNtrack])->SetPolarisation(TVector3(polar[0],polar[1],polar[2]));
- ((TParticle*)particles[fNtrack])->SetWeight(weight);
+ particle->SetPolarisation(TVector3(polar[0],polar[1],polar[2]));
+ particle->SetWeight(weight);
particle->SetUniqueID(mech);
if(!done) particle->SetBit(kDoneBit);
- //Declare that the daughter information is valid
- ((TParticle*)particles[fNtrack])->SetBit(kDaughtersBit);
-
+ // Declare that the daughter information is valid
+ particle->SetBit(kDaughtersBit);
+ // Add the particle to the stack
+ fParticleMap->AddAtAndExpand(particle,fNtrack);
+
if(parent>=0) {
- particle=(TParticle*) fParticles->UncheckedAt(parent);
+ particle=(TParticle*) fParticleMap->At(parent);
particle->SetLastDaughter(fNtrack);
if(particle->GetFirstDaughter()<0) particle->SetFirstDaughter(fNtrack);
} else {
//
// flags a track to be kept
//
- TClonesArray &particles = *fParticles;
- ((TParticle*)particles[track])->SetBit(kKeepBit);
+ fParticleMap->At(track)->SetBit(kKeepBit);
}
//_____________________________________________________________________________
//_____________________________________________________________________________
void AliRun::Streamer(TBuffer &R__b)
{
- //
- // Stream an object of class AliRun.
- //
- if (R__b.IsReading()) {
- Version_t R__v = R__b.ReadVersion(); if (R__v) { }
- TNamed::Streamer(R__b);
- if (!gAlice) gAlice = this;
- gROOT->GetListOfBrowsables()->Add(this,"Run");
- fTreeE = (TTree*)gDirectory->Get("TE");
- if (fTreeE) fTreeE->SetBranchAddress("Header", &gAliHeader);
- else Error("Streamer","cannot find Header Tree\n");
- R__b >> fNtrack;
- R__b >> fHgwmk;
- R__b >> fDebug;
- fHeader.Streamer(R__b);
- R__b >> fModules;
- R__b >> fParticles;
- R__b >> fField;
- // R__b >> fMC;
- R__b >> fNdets;
- R__b >> fTrRmax;
- R__b >> fTrZmax;
- R__b >> fGenerator;
- if(R__v>1) {
- R__b >> fPDGDB; //Particle factory object!
+ // Stream an object of class AliRun.
+
+ if (R__b.IsReading()) {
+ if (!gAlice) gAlice = this;
+
+ AliRun::Class()->ReadBuffer(R__b, this);
+ //
+ gROOT->GetListOfBrowsables()->Add(this,"Run");
+
+ fTreeE = (TTree*)gDirectory->Get("TE");
+ if (fTreeE) fTreeE->SetBranchAddress("Header", &gAliHeader);
+ else Error("Streamer","cannot find Header Tree\n");
fTreeE->GetEntry(0);
- } else {
- fHeader.SetEvent(0);
- fPDGDB = TDatabasePDG::Instance(); //Particle factory object!
- }
- if(R__v>2) {
- fConfigFunction.Streamer(R__b);
- } else {
- fConfigFunction="Config();";
- }
- if(R__v>3) {
- R__b >> fRandom;
+
gRandom = fRandom;
- R__b >> fMCQA;
- } else {
- fRandom = gRandom = new TRandom3();
- fMCQA = new AliMCQA();
- }
- } else {
- R__b.WriteVersion(AliRun::IsA());
- TNamed::Streamer(R__b);
- R__b << fNtrack;
- R__b << fHgwmk;
- R__b << fDebug;
- fHeader.Streamer(R__b);
- R__b << fModules;
- R__b << fParticles;
- R__b << fField;
- // R__b << fMC;
- R__b << fNdets;
- R__b << fTrRmax;
- R__b << fTrZmax;
- R__b << fGenerator;
- R__b << fPDGDB; //Particle factory object!
- fConfigFunction.Streamer(R__b);
- R__b << fRandom;
- R__b << fMCQA;
- }
-}
+ } else {
+ AliRun::Class()->WriteBuffer(R__b, this);
+ }
+}
+
class TGeometry;
class TDatabasePDG;
class TRandom;
-class AliMCQA;
+class TParticle;
#include <TArrayI.h>
#include "TClonesArray.h"
#include <TArrayF.h>
class AliGenerator;
class AliLegoGenerator;
#include "AliMCProcess.h"
+class AliMCQA;
enum {kKeepBit=1, kDaughtersBit=2, kDoneBit=4};
virtual void DumpPart (Int_t i) const;
virtual void DumpPStack () const;
virtual AliMagF *Field() const {return fField;}
- virtual void FillTree();
virtual void PreTrack();
virtual void PostTrack();
virtual void FinishPrimary();
Float_t &tof);
Int_t GetNtrack() const {return fNtrack;}
virtual Int_t GetPrimary(Int_t track) const;
+ virtual void Hits2Digits(const char *detector=0);
+ virtual void Hits2SDigits(const char *detector=0);
+ virtual void SDigits2Digits(const char *detector=0);
virtual void InitMC(const char *setup="Config.C");
virtual void Init(const char *setup="Config.C") {InitMC(setup);}
Bool_t IsFolder() const {return kTRUE;}
virtual AliLego* Lego() const {return fLego;}
- virtual void MakeTree(Option_t *option="KH");
- TClonesArray *Particles() {return fParticles;};
+ virtual void MakeTree(Option_t *option="KH", char *file = 0);
+ virtual void MakeBranchInTree(TTree *tree, const char* cname, void* address, Int_t size=32000, char *file=0);
+ virtual void MakeBranchInTree(TTree *tree, const char* cname, const char* name, void* address, Int_t size=32000, Int_t splitlevel=1, char *file=0);
+
+ TObjArray *Particles() {return fParticleMap;};
+ TParticle *Particle(Int_t i);
virtual void PurifyKine();
virtual Int_t PurifyKine(Int_t lastSavedTrack, Int_t nofTracks);
virtual void BeginEvent();
virtual void ResetDigits();
+ virtual void ResetSDigits();
virtual void ResetHits();
virtual void ResetPoints();
virtual void SetTransPar(char *filename="$(ALICE_ROOT)/data/galice.cuts");
+ virtual void SetBaseFile(char *filename="galice.root");
+ virtual void OpenBaseFile(const char *option);
virtual void ReadTransPar();
- virtual void ResetStack() {fCurrent=-1;fHgwmk=0;fNtrack=0;fParticles->Clear();}
+ virtual void ResetStack() {fCurrent=-1;fHgwmk=fNtrack=fLoadPoint=0;fParticles->Clear();}
virtual void RunMC(Int_t nevent=1, const char *setup="Config.C");
virtual void Run(Int_t nevent=1, const char *setup="Config.C")
{RunMC(nevent,setup);}
TTree *TreeD() {return fTreeD;}
+ TTree *TreeS() {return fTreeS;}
TTree *TreeE() {return fTreeE;}
TTree *TreeH() {return fTreeH;}
TTree *TreeK() {return fTreeK;}
TTree *TreeR() {return fTreeR;}
protected:
- Int_t fRun; //Current run number
- Int_t fEvent; //Current event number (from 1)
- Int_t fNtrack; //Number of tracks
- Int_t fHgwmk; //Last track purified
- Int_t fCurrent; //Last track returned from the stack
- Int_t fDebug; //Debug flag
- AliHeader fHeader; //Header information
- TTree *fTreeD; //Pointer to Tree for Digits
- TTree *fTreeK; //Pointer to Tree for Kinematics
- TTree *fTreeH; //Pointer to Tree for Hits
- TTree *fTreeE; //Pointer to Tree for Header
- TTree *fTreeR; //Pointer to Tree for Reconstructed Objects
- TObjArray *fModules; //List of Detectors
- TClonesArray *fParticles; //Pointer to list of particles
- TGeometry *fGeometry; //Pointer to geometry
- AliDisplay *fDisplay; //Pointer to event display
- TStopwatch fTimer; //Timer object
- AliMagF *fField; //Magnetic Field Map
- AliMC *fMC; //pointer to MonteCarlo object
- TArrayI *fImedia; //Array of correspondence between media and detectors
- Int_t fNdets; //Number of detectors
- Float_t fTrRmax; //Maximum radius for tracking
- Float_t fTrZmax; //Maximu z for tracking
- AliGenerator *fGenerator; //Generator used in the MC
- Bool_t fInitDone; //true when initialisation done
- AliLego *fLego; //pointer to aliLego object if it exists
- TDatabasePDG *fPDGDB; //Particle factory object!
- TList *fHitLists; //Lists of hits to be remapped by PurifyKine
- TArrayF fEventEnergy; //Energy deposit for current event
- TArrayF fSummEnergy; //Energy per event in each volume
- TArrayF fSum2Energy; //Energy squared per event in each volume
- TString fConfigFunction; //Configuration file to be executed
- TRandom *fRandom; // Pointer to the random number generator
- AliMCQA *fMCQA; //Pointer to MC Quality assurance class
- TString fTransParName; // Name of the transport parameters file
+ Int_t fRun; //! Current run number
+ Int_t fEvent; //! Current event number (from 1)
+ Int_t fNtrack; // Number of tracks
+ Int_t fHgwmk; //! Last track purified
+ Int_t fLoadPoint; //! Next free position in the particle buffer
+ Int_t fCurrent; //! Last track returned from the stack
+ Int_t fDebug; // Debug flag
+ AliHeader fHeader; // Header information
+ TTree *fTreeD; //! Pointer to Tree for Digits
+ TTree *fTreeS; //! Pointer to Tree for SDigits
+ TTree *fTreeK; //! Pointer to Tree for Kinematics
+ TTree *fTreeH; //! Pointer to Tree for Hits
+ TTree *fTreeE; //! Pointer to Tree for Header
+ TTree *fTreeR; //! Pointer to Tree for Reconstructed Objects
+ TObjArray *fModules; // List of Detectors
+ TClonesArray *fParticles; //! Pointer to list of particles
+ TGeometry *fGeometry; // Pointer to geometry
+ AliDisplay *fDisplay; //! Pointer to event display
+ TStopwatch fTimer; // Timer object
+ AliMagF *fField; // Magnetic Field Map
+ AliMC *fMC; //! Pointer to MonteCarlo object
+ TArrayI *fImedia; //! Array of correspondence between media and detectors
+ Int_t fNdets; // Number of detectors
+ Float_t fTrRmax; // Maximum radius for tracking
+ Float_t fTrZmax; // Maximu z for tracking
+ AliGenerator *fGenerator; // Generator used in the MC
+ Bool_t fInitDone; //! True when initialisation done
+ AliLego *fLego; //! Pointer to aliLego object if it exists
+ TDatabasePDG *fPDGDB; // Particle factory object
+ TList *fHitLists; //! Lists of hits to be remapped by PurifyKine
+ TArrayF fEventEnergy; //! Energy deposit for current event
+ TArrayF fSummEnergy; //! Energy per event in each volume
+ TArrayF fSum2Energy; //! Energy squared per event in each volume
+ TString fConfigFunction; // Configuration file to be executed
+ TRandom *fRandom; // Pointer to the random number generator
+ AliMCQA *fMCQA; // Pointer to MC Quality assurance class
+ TString fTransParName; // Name of the transport parameters file
+ TString fBaseFileName; // Name of the base root file
+ TParticle *fParticleBuffer; //! Pointer to current particle for writing
+ TObjArray *fParticleMap; //! Map of particles in the supporting TClonesArray
+ TArrayI fParticleFileMap; // Map of particles in the file
private:
#pragma link C++ enum VertexSmear_t;
#pragma link C++ enum PDG_t;
-#pragma link C++ class AliGenerator;
+#pragma link C++ class AliGenerator+;
#pragma link C++ class AliRun-;
-#pragma link C++ class AliModule-;
-#pragma link C++ class AliDetector-;
-#pragma link C++ class AliDigit;
-#pragma link C++ class AliHit;
-#pragma link C++ class AliHeader;
-#pragma link C++ class AliDisplay;
-#pragma link C++ class AliPoints;
-#pragma link C++ class AliMagF;
-#pragma link C++ class AliMagFC;
-#pragma link C++ class AliMagFCM;
-#pragma link C++ class AliMagFDM;
-#pragma link C++ class AliMC;
-#pragma link C++ class AliLego;
-#pragma link C++ class AliLegoGenerator;
-#pragma link C++ class AliLegoGeneratorXYZ;
-#pragma link C++ class AliLegoGeneratorPhiZ;
-#pragma link C++ class AliLegoGeneratorEta;
-#pragma link C++ class AliDigitNew;
-#pragma link C++ class AliGeometry;
-#pragma link C++ class AliRecPoint;
-#pragma link C++ class AliSegmentation;
-#pragma link C++ class AliHitMap;
-#pragma link C++ class AliCluster;
-#pragma link C++ class AliKalmanTrack-;
-#pragma link C++ class AliRndm;
-#pragma link C++ class AliMCQA;
-#pragma link C++ class AliPDG;
+#pragma link C++ class AliModule+;
+#pragma link C++ class AliDetector+;
+#pragma link C++ class AliDigit+;
+#pragma link C++ class AliHit+;
+#pragma link C++ class AliHeader+;
+#pragma link C++ class AliDisplay+;
+#pragma link C++ class AliPoints+;
+#pragma link C++ class AliMagF+;
+#pragma link C++ class AliMagFC+;
+#pragma link C++ class AliMagFCM+;
+#pragma link C++ class AliMagFDM+;
+#pragma link C++ class AliMC+;
+#pragma link C++ class AliLego+;
+#pragma link C++ class AliLegoGenerator+;
+#pragma link C++ class AliLegoGeneratorXYZ+;
+#pragma link C++ class AliLegoGeneratorPhiZ+;
+#pragma link C++ class AliLegoGeneratorEta+;
+#pragma link C++ class AliDigitNew+;
+#pragma link C++ class AliGeometry+;
+#pragma link C++ class AliRecPoint+;
+#pragma link C++ class AliSegmentation+;
+#pragma link C++ class AliHitMap+;
+#pragma link C++ class AliCluster+;
+#pragma link C++ class AliKalmanTrack+;
+#pragma link C++ class AliRndm+;
+#pragma link C++ class AliMCQA+;
+#pragma link C++ class AliPDG+;
#endif
#pragma link off all classes;
#pragma link off all functions;
-#pragma link C++ class AliBODY;
-#pragma link C++ class AliMAG;
-#pragma link C++ class AliABSO;
-#pragma link C++ class AliABSOv0;
-#pragma link C++ class AliDIPO;
-#pragma link C++ class AliDIPOv1;
-#pragma link C++ class AliDIPOv2;
-#pragma link C++ class AliFRAME;
-#pragma link C++ class AliFRAMEv0;
-#pragma link C++ class AliFRAMEv1;
-#pragma link C++ class AliHALL;
-#pragma link C++ class AliPIPE;
-#pragma link C++ class AliPIPEv0;
-#pragma link C++ class AliPIPEv1;
-#pragma link C++ class AliPIPEv3;
-#pragma link C++ class AliSHIL;
-#pragma link C++ class AliSHILv0;
-#pragma link C++ class AliALIFE;
+#pragma link C++ class AliBODY+;
+#pragma link C++ class AliMAG+;
+#pragma link C++ class AliABSO+;
+#pragma link C++ class AliABSOv0+;
+#pragma link C++ class AliDIPO+;
+#pragma link C++ class AliDIPOv1+;
+#pragma link C++ class AliDIPOv2+;
+#pragma link C++ class AliFRAME+;
+#pragma link C++ class AliFRAMEv0+;
+#pragma link C++ class AliFRAMEv1+;
+#pragma link C++ class AliHALL+;
+#pragma link C++ class AliPIPE+;
+#pragma link C++ class AliPIPEv0+;
+#pragma link C++ class AliPIPEv1+;
+#pragma link C++ class AliPIPEv3+;
+#pragma link C++ class AliSHIL+;
+#pragma link C++ class AliSHILv0+;
+#pragma link C++ class AliALIFE+;
#endif
#pragma link off all classes;
#pragma link off all functions;
-#pragma link C++ class AliGeant3;
+#pragma link C++ class AliGeant3+;
#pragma link C++ class TGeant3-;
-#pragma link C++ class THIGZ;
-#pragma link C++ class TPaveTree;
+#pragma link C++ class THIGZ+;
+#pragma link C++ class TPaveTree+;
#pragma link C++ class AliGuiGeomMain-;
#pragma link C++ class AliDrawVolume-;
#pragma link C++ class AliGeant3GeometryGUI-;
#pragma link C++ class AliGUIMedium-;
-#pragma link C++ class Quest_t;
-#pragma link C++ class Gcbank_t;
-#pragma link C++ class Gclink_t;
-#pragma link C++ class Gcflag_t;
-#pragma link C++ class Gckine_t;
-#pragma link C++ class Gcking_t;
-#pragma link C++ class Gckin2_t;
-#pragma link C++ class Gckin3_t;
-#pragma link C++ class Gcmate_t;
-#pragma link C++ class Gctmed_t;
-#pragma link C++ class Gctrak_t;
-#pragma link C++ class Gcvolu_t;
-#pragma link C++ class Gcsets_t;
-#pragma link C++ class Gcnum_t;
-#pragma link C++ class Gccuts_t;
-#pragma link C++ class Gcmulo_t;
-#pragma link C++ class Gcphys_t;
-#pragma link C++ class Gcopti_t;
-#pragma link C++ class Gctlit_t;
-#pragma link C++ class Gcvdma_t;
-#pragma link C++ class Gctpol_t;
-#pragma link C++ class Ertrio_t;
-#pragma link C++ class Eropts_t;
-#pragma link C++ class Eroptc_t;
-#pragma link C++ class Erwork_t;
+#pragma link C++ class Quest_t+;
+#pragma link C++ class Gcbank_t+;
+#pragma link C++ class Gclink_t+;
+#pragma link C++ class Gcflag_t+;
+#pragma link C++ class Gckine_t+;
+#pragma link C++ class Gcking_t+;
+#pragma link C++ class Gckin2_t+;
+#pragma link C++ class Gckin3_t+;
+#pragma link C++ class Gcmate_t+;
+#pragma link C++ class Gctmed_t+;
+#pragma link C++ class Gctrak_t+;
+#pragma link C++ class Gcvolu_t+;
+#pragma link C++ class Gcsets_t+;
+#pragma link C++ class Gcnum_t+;
+#pragma link C++ class Gccuts_t+;
+#pragma link C++ class Gcmulo_t+;
+#pragma link C++ class Gcphys_t+;
+#pragma link C++ class Gcopti_t+;
+#pragma link C++ class Gctlit_t+;
+#pragma link C++ class Gcvdma_t+;
+#pragma link C++ class Gctpol_t+;
+#pragma link C++ class Ertrio_t+;
+#pragma link C++ class Eropts_t+;
+#pragma link C++ class Eroptc_t+;
+#pragma link C++ class Erwork_t+;
#endif
#pragma link off all classes;
#pragma link off all functions;
-#pragma link C++ class TGeant4;
-#pragma link C++ class TG4VRunConfiguration;
-#pragma link C++ class TG4Editor;
-#pragma link C++ class TG4GUI;
-#pragma link C++ class TG4GeometryGUI;
-#pragma link C++ class TG4GuiVolume;
+#pragma link C++ class TGeant4+;
+#pragma link C++ class TG4VRunConfiguration+;
+#pragma link C++ class TG4Editor+;
+#pragma link C++ class TG4GUI+;
+#pragma link C++ class TG4GeometryGUI+;
+#pragma link C++ class TG4GuiVolume+;
#endif
#pragma link off all classes;
#pragma link off all functions;
-#pragma link C++ class THijing;
+#pragma link C++ class THijing+;
#endif
/*
$Log$
+Revision 1.17 2000/10/19 09:58:14 vicinanz
+Updated Hits2Digit procedure
+
Revision 1.16 2000/10/02 21:28:17 fca
Removal of useless dependecies via forward declarations
#include "TObject.h"
#include "TRandom.h"
#include "TTree.h"
+#include "TFile.h"
#include "AliRun.h"
#include "AliMC.h"
}
//____________________________________________________________________________
-void AliTOF::MakeBranch(Option_t* option)
+void AliTOF::MakeBranch(Option_t* option, char *file)
//
// Initializes the Branches of the TOF inside the
// trees written for each event.
//
{
- AliDetector::MakeBranch(option);
+ AliDetector::MakeBranch(option,file);
Int_t buffersize = 4000;
Char_t branchname[10];
sprintf(branchname,"%s",GetName());
+
char *D = strstr(option,"D");
if (fDigits && gAlice->TreeD() && D){
- gAlice->TreeD()->Branch(branchname,&fDigits,buffersize);
- printf("Making Branch %s for digits \n",branchname);
+ gAlice->MakeBranchInTree(gAlice->TreeD(),
+ branchname, &fDigits,buffersize, file) ;
}
}
// Hits2Digits();
}
+//___________________________________________
+void AliTOF::SDigits2Digits()
+{
+//
+// Genneratedigits
+//
+ int nparticles = gAlice->GetNtrack();
+ cout << "Particles :" <<nparticles<<endl;
+ if (nparticles > 0 ) {
+ Hits2Digits(0);
+ }
+}
//____________________________________________________________________________
void AliTOF::Hits2Digits(Int_t evNumber)
Float_t digit[2];
TClonesArray* TOFhits=this->Hits();
- Int_t nparticles = gAlice->GetEvent(evNumber);
+ Int_t nparticles = gAlice->GetNtrack();
if (nparticles <= 0) return;
TD = gAlice->TreeD();
////////////////////////////////////////////////
// Manager and hits classes for set: TOF //
////////////////////////////////////////////////
+#include "TObject.h"
+
+class TFile;
#include "AliDetector.h"
#include "AliHit.h"
#include "AliDigit.h"
-#include "TObject.h"
#include "AliTOFD.h"
class AliTOF : public AliDetector {
virtual void CreateGeometry();
virtual void CreateMaterials();
virtual void Init();
- virtual void MakeBranch(Option_t*);
+ virtual void MakeBranch(Option_t*, char *file=0);
virtual void FinishEvent();
virtual Int_t IsVersion() const =0;
Int_t DistancetoPrimitive(Int_t px, Int_t py);
virtual void TOFpc(Float_t, Float_t, Float_t,
Float_t, Float_t,Float_t) {}
virtual void DrawModule();
+ virtual void SDigits2Digits();
void Hits2Digits(Int_t evNumber=0);
void Digits2Raw (Int_t evNumber=0);
void Raw2Digits (Int_t evNumber=0);
#pragma link off all classes;
#pragma link off all functions;
-#pragma link C++ class AliTOF;
-#pragma link C++ class AliTOFv0;
-#pragma link C++ class AliTOFv1;
-#pragma link C++ class AliTOFv2;
-#pragma link C++ class AliTOFv3;
-#pragma link C++ class AliTOFv4;
+#pragma link C++ class AliTOF+;
+#pragma link C++ class AliTOFv0+;
+#pragma link C++ class AliTOFv1+;
+#pragma link C++ class AliTOFv2+;
+#pragma link C++ class AliTOFv3+;
+#pragma link C++ class AliTOFv4+;
-#pragma link C++ class AliTOFhit;
+#pragma link C++ class AliTOFhit+;
-#pragma link C++ class AliTOFdigit;
-#pragma link C++ class AliTOFRoc;
-#pragma link C++ class AliTOFRawSector;
-#pragma link C++ class AliTOFRawDigit;
+#pragma link C++ class AliTOFdigit+;
+#pragma link C++ class AliTOFRoc+;
+#pragma link C++ class AliTOFRawSector+;
+#pragma link C++ class AliTOFRawDigit+;
#endif
/*
$Log$
+Revision 1.27 2001/01/13 17:29:33 kowal2
+Sun compiler correction
+
Revision 1.26 2001/01/10 07:59:43 kowal2
Corrections to load points from the noncompressed hits.
#include <TFile.h>
#include "AliRun.h"
#include <iostream.h>
+#include <stdlib.h>
#include <fstream.h>
#include "AliMC.h"
#include "AliMagF.h"
//
TParticle *particle; // pointer to a given particle
AliTPChit *tpcHit; // pointer to a sigle TPC hit
- TClonesArray *particles; //pointer to the particle list
Int_t sector;
Int_t ipart;
Float_t xyz[5];
TTree *tH = gAlice->TreeH();
Stat_t ntracks = tH->GetEntries();
- particles=gAlice->Particles();
//Switch to the output file
of->cd();
continue;
}
ipart=tpcHit->Track();
- particle=(TParticle*)particles->UncheckedAt(ipart);
+ particle=gAlice->Particle(ipart);
pl=particle->Pz();
pt=particle->Pt();
if(pt < 1.e-9) pt=1.e-9;
//
TParticle *particle; // pointer to a given particle
AliTPChit *tpcHit; // pointer to a sigle TPC hit
- TClonesArray *particles; //pointer to the particle list
Int_t sector,nhits;
Int_t ipart;
const Int_t kcmaxhits=30000;
TTree *tH = gAlice->TreeH();
Stat_t ntracks = tH->GetEntries();
- particles=gAlice->Particles();
- Int_t npart = particles->GetEntriesFast();
+ Int_t npart = gAlice->GetNtrack();
//------------------------------------------------------------
// Loop over tracks
sector=tpcHit->fSector; // sector number
if(sector != isec) continue;
ipart=tpcHit->Track();
- if (ipart<npart) particle=(TParticle*)particles->UncheckedAt(ipart);
+ if (ipart<npart) particle=gAlice->Particle(ipart);
//find row number
xxxx->Delete();
}
+//___________________________________________
+void AliTPC::SDigits2Digits()
+{
+ AliTPCParamSR *param=(AliTPCParamSR*)gDirectory->Get("75x40_100x60");
+ AliTPCPRF2D * prfinner = new AliTPCPRF2D;
+ AliTPCPRF2D * prfouter = new AliTPCPRF2D;
+ AliTPCRF1D * rf = new AliTPCRF1D(kTRUE);
+
+ TDirectory *cwd = gDirectory;
+ rf->SetGauss(param->GetZSigma(),param->GetZWidth(),1.);
+ rf->SetOffset(3*param->GetZSigma());
+ rf->Update();
+ TFile *f=TFile::Open("$ALICE_ROOT/TPC/AliTPCprf2d.root");
+ if (!f->IsOpen()) {
+ cerr<<"Can't open $ALICE_ROOT/TPC/AliTPCprf2d.root !\n";
+ exit(3);
+ }
+ prfinner->Read("prf_07504_Gati_056068_d02");
+ prfouter->Read("prf_10006_Gati_047051_d03");
+ f->Close();
+ cwd->cd();
+
+ param->SetInnerPRF(prfinner);
+ param->SetOuterPRF(prfouter);
+ param->SetTimeRF(rf);
+
+ SetParam(param);
+
+ cerr<<"Digitizing TPC...\n";
+
+ //setup TPCDigitsArray
+ AliTPCDigitsArray *arr = new AliTPCDigitsArray;
+ arr->SetClass("AliSimDigits");
+ arr->Setup(param);
+ SetParam(param);
+
+ arr->MakeTree(fDigitsFile);
+
+ SetDigitsArray(arr);
+
+ Hits2Digits();
+
+ // Hits2DigitsSector(1);
+ // Hits2DigitsSector(2);
+ // Hits2DigitsSector(3);
+ // Hits2DigitsSector(1+18);
+ // Hits2DigitsSector(2+18);
+ // Hits2DigitsSector(3+18);
+
+ // Hits2DigitsSector(36+1);
+ // Hits2DigitsSector(36+2);
+ // Hits2DigitsSector(36+3);
+ // Hits2DigitsSector(36+1+18);
+ // Hits2DigitsSector(36+2+18);
+ // Hits2DigitsSector(36+3+18);
+
+ //write results
+
+ char treeName[100];
+ sprintf(treeName,"TreeD_%s",param->GetTitle());
+ GetDigitsArray()->GetTree()->Write(treeName,TObject::kOverwrite);
+}
//__________________________________________________________________
void AliTPC::Hits2Digits()
Int_t i;
- if (fDigitsArray->GetTree()==0) fDigitsArray->MakeTree();
+ if (fDigitsArray->GetTree()==0) fDigitsArray->MakeTree(fDigitsFile);
for (i=0;i<nrows;i++){
}
//_____________________________________________________________________________
-void AliTPC::MakeBranch(Option_t* option)
+void AliTPC::MakeBranch(Option_t* option, char *file)
{
//
// Create Tree branches for the TPC.
char branchname[10];
sprintf(branchname,"%s",GetName());
- AliDetector::MakeBranch(option);
+ AliDetector::MakeBranch(option,file);
char *d = strstr(option,"D");
if (fDigits && gAlice->TreeD() && d) {
- gAlice->TreeD()->Branch(branchname,&fDigits, buffersize);
- printf("Making Branch %s for digits\n",branchname);
+ gAlice->MakeBranchInTree(gAlice->TreeD(),
+ branchname, &fDigits, buffersize, file) ;
}
- if (fHitType&2) MakeBranch2(option); // MI change 14.09.2000
+ if (fHitType&2) MakeBranch2(option,file); // MI change 14.09.2000
}
//_____________________________________________________________________________
//add nonisochronity (not implemented yet)
}
-//_____________________________________________________________________________
-void AliTPC::Streamer(TBuffer &R__b)
-{
- //
- // Stream an object of class AliTPC.
- //
- if (R__b.IsReading()) {
- Version_t R__v = R__b.ReadVersion(); if (R__v) { }
- AliDetector::Streamer(R__b);
- R__b >> fTPCParam;
- if (R__v < 2) return;
- R__b >> fNsectors;
- R__b >> fHitType;
-
- } else {
- R__b.WriteVersion(AliTPC::IsA());
- AliDetector::Streamer(R__b);
- R__b << fTPCParam;
- R__b << fNsectors;
- R__b << fHitType;
- }
-}
ClassImp(AliTPCdigit)
//________________________________________________________________________
// Additional code because of the AliTPCTrackHits
-void AliTPC::MakeBranch2(Option_t *option)
+void AliTPC::MakeBranch2(Option_t *option,char *file)
{
//
// Create a new branch in the current Root Tree
char *cH = strstr(option,"H");
//
if (fTrackHits && gAlice->TreeH() && cH) {
- // gAlice->TreeH()->Branch(branchname,&fTrackHits, fBufferSize);
AliObjectBranch * branch = new AliObjectBranch(branchname,"AliTPCTrackHits",&fTrackHits,
gAlice->TreeH(),fBufferSize,1);
gAlice->TreeH()->GetListOfBranches()->Add(branch);
printf("* AliDetector::MakeBranch * Making Branch %s for trackhits\n",branchname);
+ if (file) {
+ TBranch *b = gAlice->TreeH()->GetBranch(branchname);
+ TDirectory *wd = gDirectory;
+ b->SetFile(file);
+ TIter next( b->GetListOfBranches());
+ while ((b=(TBranch*)next())) {
+ b->SetFile(file);
+ }
+ wd->cd();
+ cout << "Diverting branch " << branchname << " to file " << file << endl;
+ }
}
}
{
//
// add hit to the list
- TClonesArray &particles = *(gAlice->Particles());
Int_t rtrack;
if (fIshunt) {
int primary = gAlice->GetPrimary(track);
- ((TParticle *)particles[primary])->SetBit(kKeepBit);
+ gAlice->Particle(primary)->SetBit(kKeepBit);
rtrack=primary;
} else {
rtrack=track;
Int_t fSecUps[12]; // List of upper sectors selected
Int_t fNsectors; // Number of sectors in TPC
//MI changes
- AliTPCDigitsArray * fDigitsArray; //detector digit object
- AliTPCClustersArray * fClustersArray; //detector cluster object
+ AliTPCDigitsArray * fDigitsArray; //!detector digit object
+ AliTPCClustersArray * fClustersArray; //!detector cluster object
AliTPCParam *fTPCParam; // pointer to TPC parameters
- AliTPCTrackHits *fTrackHits; //hits for given track M.I.
+ AliTPCTrackHits *fTrackHits; //!hits for given track M.I.
Int_t fHitType; // if fNewHit = 1 old data structure if 2 new hits
// 3 both types
virtual void CreateMaterials();
virtual void Hits2Clusters(TFile *of);
virtual void Hits2ExactClustersSector(Int_t isec); // MI change calculate "exact" cluster position
+ virtual void SDigits2Digits();
virtual void Hits2Digits(); //MI change
- virtual void Hits2DigitsSector(Int_t isec); //MI change
+ virtual void Hits2DigitsSector(Int_t isec); //MI change
virtual void Init();
virtual Int_t IsVersion() const =0;
virtual void Digits2Clusters(TFile *of);
virtual void Clusters2Tracks(TFile *of);
Int_t GetNsectors() {return fNsectors;}
- virtual void MakeBranch(Option_t *opt=" ");
+ virtual void MakeBranch(Option_t *opt=" ", char *file=0 );
virtual void ResetDigits();
virtual void SetSecAL(Int_t sec);
virtual void SetSecAU(Int_t sec);
void SetClustersArray(AliTPCClustersArray *clusters) {fClustersArray = clusters;} //MI change
// additional function neccesary for the new hits
- virtual void MakeBranch2(Option_t *opt=" "); //
+ virtual void MakeBranch2(Option_t *opt=" ", char *file=0); //
virtual void SetTreeAddress();
virtual void SetTreeAddress2();
virtual void AddHit2(Int_t a1, Int_t *a2, Float_t *a3); //
/*
$Log$
+Revision 1.4 2000/10/05 16:08:15 kowal2
+Changes due to a new class AliComplexCluster. Forward declarations.
+
Revision 1.3 2000/07/10 20:57:39 hristov
Update of TPC code and macros by M.Kowalski
-void AliTPCClusterFinder::Streamer(TBuffer & R__b)
-{
- if (R__b.IsReading()) {
- // Version_t R__v = R__b.ReadVersion();
- } else {
- R__b.WriteVersion(AliTPCClusterFinder::IsA());
- }
-}
-
-
-
void AliTPCClusterFinder::SetBlockIndex(Int_t * index)
{
//
return 3;
}
+ TDirectory *cwd = gDirectory;
+
gAlice->GetEvent(0);
AliTPC *TPC = (AliTPC*)gAlice->GetDetector("TPC");
cerr<<"Making clusters...\n";
{
AliTPCv1 &tpc=*((AliTPCv1*)TPC);
- tpc.SetParam(dig); timer.Start(); tpc.Hits2Clusters(out);
+ tpc.SetParam(dig); timer.Start(); cwd->cd(); tpc.Hits2Clusters(out);
}
break;
case 2:
{
delete gAlice; gAlice=0;
AliTPCv2 tpc;
- tpc.SetParam(dig); timer.Start(); tpc.Digits2Clusters(out);
+ tpc.SetParam(dig); timer.Start(); cwd->cd(); tpc.Digits2Clusters(out);
}
break;
default:
/*
$Log$
+Revision 1.4 2000/11/02 07:33:15 kowal2
+Improvements of the code.
+
Revision 1.3 2000/06/30 12:07:50 kowal2
Updated from the TPC-PreRelease branch
#include <iostream.h>
#include <TMath.h>
-#include <TObject.h>
+#include <TClass.h>
#include <AliTPCParamCR.h>
#include "AliTPCPRF2D.h"
#include "AliTPCRF1D.h"
// Stream an object of class AliTPC.
if (R__b.IsReading()) {
- Version_t R__v = R__b.ReadVersion(); if (R__v) { }
- // TObject::Streamer(R__b);
- AliTPCParam::Streamer(R__b);
- // if (R__v < 2) return;
- Update();
+ AliTPCParamCR::Class()->ReadBuffer(R__b, this);
+ Update();
} else {
- R__b.WriteVersion(AliTPCParamCR::IsA());
- //TObject::Streamer(R__b);
- AliTPCParam::Streamer(R__b);
+ AliTPCParamCR::Class()->WriteBuffer(R__b, this);
}
}
AliTPCPRF2D * GetOuterPRF() const {return fOuterPRF;}
AliTPCRF1D * GetTimeRF() const {return fTimeRF;}
protected:
- AliTPCPRF2D * fInnerPRF; //pad response function object for inner sector
- AliTPCPRF2D * fOuterPRF; //pad response function object for inner sector
- AliTPCRF1D * fTimeRF; //time response function object
+ AliTPCPRF2D * fInnerPRF; //!pad response function object for inner sector
+ AliTPCPRF2D * fOuterPRF; //!pad response function object for inner sector
+ AliTPCRF1D * fTimeRF; //!time response function object
Float_t fFacSigma; //factor-how many sigma of response I accept
ClassDef(AliTPCParamCR,1) //parameter object for set:TPC
};
/*
$Log$
+Revision 1.6 2000/06/30 12:07:50 kowal2
+Updated from the TPC-PreRelease branch
+
Revision 1.5.4.3 2000/06/26 07:39:42 kowal2
Changes to obey the coding rules
void AliTPCRF1D::Streamer(TBuffer &R__b)
{
// Stream an object of class AliTPCRF1D.
- Float_t dummy;
if (R__b.IsReading()) {
- Version_t R__v = R__b.ReadVersion(); if (R__v) { }
- TObject::Streamer(R__b);
- //read pad parameters
- R__b >> fpadWidth;
- //read charge parameters
- R__b >> fType[0];
- R__b >> fType[1];
- R__b >> fType[2];
- R__b >> fType[3];
- R__b >> fType[4];
- R__b >> forigsigma;
- R__b >> fkNorm;
- R__b >> dummy; //dummuy instead fK3X in previous
- R__b >> fPadDistance;
- R__b >> fInteg;
- R__b >> fOffset;
+ AliTPCRF1D::Class()->ReadBuffer(R__b, this);
//read functions
- if (fGRF!=0) {
- delete [] fGRF;
- fGRF=0;
- }
- if (strncmp(fType,"User",3)==0){
- fGRF= new TF1;
- R__b>>fGRF;
- }
- if (strncmp(fType,"Gauss",3)==0)
- fGRF = new TF1("fun",funGauss,-5.,5.,4);
- if (strncmp(fType,"Cosh",3)==0)
- fGRF = new TF1("fun",funCosh,-5.,5.,4);
- if (strncmp(fType,"Gati",3)==0)
- fGRF = new TF1("fun",funGati,-5.,5.,4);
- R__b >>fDSTEPM1;
- R__b >>fNRF;
- R__b.ReadFastArray(fcharge,fNRF);
- R__b.ReadFastArray(funParam,5);
- if (fGRF!=0) fGRF->SetParameters(funParam);
+ if (strncmp(fType,"Gauss",3)==0) {delete fGRF; fGRF = new TF1("fun",funGauss,-5.,5.,4);}
+ if (strncmp(fType,"Cosh",3)==0) {delete fGRF; fGRF = new TF1("fun",funCosh,-5.,5.,4);}
+ if (strncmp(fType,"Gati",3)==0) {delete fGRF; fGRF = new TF1("fun",funGati,-5.,5.,4);}
+ if (fGRF) fGRF->SetParameters(funParam);
} else {
- R__b.WriteVersion(AliTPCRF1D::IsA());
- TObject::Streamer(R__b);
- //write pad width
- R__b << fpadWidth;
- //write charge parameters
- R__b << fType[0];
- R__b << fType[1];
- R__b << fType[2];
- R__b << fType[3];
- R__b << fType[4];
- R__b << forigsigma;
- R__b << fkNorm;
- R__b << dummy; //dummuy instead fK3X in previouis
- R__b << fPadDistance;
- R__b << fInteg;
- R__b << fOffset;
- //write interpolation parameters
- if (strncmp(fType,"User",3)==0) R__b <<fGRF;
- R__b <<fDSTEPM1;
- R__b <<fNRF;
- R__b.WriteFastArray(fcharge,fNRF);
- R__b.WriteFastArray(funParam,5);
+ AliTPCRF1D::Class()->WriteBuffer(R__b, this);
}
}
Double_t funParam[5];//parameters of used charge function
Int_t fNRF; //number of interpolations point
Float_t fDSTEPM1; //element step for point
- Float_t* fcharge; // field with RF
+ Float_t* fcharge; //[fNPRF] field with RF
Float_t forigsigma;//sigma of original distribution;
Float_t fpadWidth; //width of pad
Float_t fkNorm; //normalisation factor of the charge integral
#pragma link off all classes;
#pragma link off all functions;
-#pragma link C++ class AliTPC-;
-#pragma link C++ class AliTPCv0;
-#pragma link C++ class AliTPCv1;
-#pragma link C++ class AliTPCv2;
-#pragma link C++ class AliTPCv3;
-#pragma link C++ class AliTPChit;
-#pragma link C++ class AliTPCdigit;
-#pragma link C++ class AliTPCcluster;
-#pragma link C++ class AliTPCtrack;
-
-#pragma link C++ class AliTPCParam;
+#pragma link C++ class AliTPC+;
+#pragma link C++ class AliTPCv0+;
+#pragma link C++ class AliTPCv1+;
+#pragma link C++ class AliTPCv2+;
+#pragma link C++ class AliTPCv3+;
+#pragma link C++ class AliTPChit+;
+#pragma link C++ class AliTPCdigit+;
+#pragma link C++ class AliTPCcluster+;
+#pragma link C++ class AliTPCtrack+;
+
+#pragma link C++ class AliTPCParam+;
#pragma link C++ class AliTPCParamSR-;
#pragma link C++ class AliTPCParamCR-;
#pragma link C++ class AliTPCRF1D-;
#pragma link C++ class AliTPCPRF2D-;
-#pragma link C++ class AliDetectorParam;
+#pragma link C++ class AliDetectorParam+;
-#pragma link C++ class AliComplexCluster;
-#pragma link C++ class AliDigitCluster;
-#pragma link C++ class AliDifCluster;
-#pragma link C++ class AliClusters;
-#pragma link C++ class AliClustersArray;
+#pragma link C++ class AliComplexCluster+;
+#pragma link C++ class AliDigitCluster+;
+#pragma link C++ class AliDifCluster+;
+#pragma link C++ class AliClusters+;
+#pragma link C++ class AliClustersArray+;
-#pragma link C++ class AliTPCClustersRow;
-#pragma link C++ class AliTPCClustersArray;
+#pragma link C++ class AliTPCClustersRow+;
+#pragma link C++ class AliTPCClustersArray+;
-#pragma link C++ class AliSimDigits;
-#pragma link C++ class AliDigitsArray;
-#pragma link C++ class AliTPCDigitsArray;
+#pragma link C++ class AliSimDigits+;
+#pragma link C++ class AliDigitsArray+;
+#pragma link C++ class AliTPCDigitsArray+;
-#pragma link C++ class AliTPCClusterFinder-;
-#pragma link C++ class AliH2F;
+#pragma link C++ class AliTPCClusterFinder+;
+#pragma link C++ class AliH2F+;
-#pragma link C++ class AliTPCTrackHits;
-#pragma link C++ class AliTrackHitsInfo;
-#pragma link C++ class AliTrackHitsParam;
-#pragma link C++ class AliHitInfo;
+#pragma link C++ class AliTPCTrackHits+;
+#pragma link C++ class AliTrackHitsInfo+;
+#pragma link C++ class AliTrackHitsParam+;
+#pragma link C++ class AliHitInfo+;
#endif
/*
$Log$
+Revision 1.23 2000/11/01 14:53:20 cblume
+Merge with TRD-develop
+
Revision 1.17.2.6 2000/10/15 23:29:08 cblume
Introduced more detailed geometry for the display
///////////////////////////////////////////////////////////////////////////////
#include <stdlib.h>
+#include <iostream.h>
#include <TMath.h>
#include <TNode.h>
#include "AliTRDgeometryHole.h"
#include "AliTRDgeometryFull.h"
#include "AliTRDrecPoint.h"
+#include "AliTRDdigitsManager.h"
ClassImp(AliTRD)
fRecPoints->Add(recPoint);
}
+//___________________________________________
+void AliTRD::SDigits2Digits()
+{
+ //
+ // Create digits
+ //
+ AliTRDdigitizer *Digitizer = new AliTRDdigitizer("digitizer","TRD digitizer class");
+
+ // Set the parameter
+ Digitizer->SetDiffusion();
+ Digitizer->SetVerbose(1);
+
+ //Digitizer->SetExB();
+ //Digitizer->SetElAttach();
+ //Digitizer->SetAttachProb();
+
+ Digitizer->InitDetector();
+
+ // Create the digits
+ Digitizer->MakeDigits();
+ cout<<"After MakeDigits"<<endl;
+
+ // Write the digits into the input file
+ if (Digitizer->Digits()->MakeBranch(fDigitsFile))
+ {
+ Digitizer->WriteDigits();
+ cout<<"After write digits"<<endl;
+
+ // Save the digitizer class in the AliROOT
+ Digitizer->Write();
+ cout<<"After write digitizer"<<endl;
+ }
+}
//_____________________________________________________________________________
void AliTRD::AddDigit(Int_t *digits, Int_t *amp)
}
//_____________________________________________________________________________
-void AliTRD::MakeBranch(Option_t* option)
+void AliTRD::MakeBranch(Option_t* option, char *file)
{
//
// Create Tree branches for the TRD digits and cluster.
//Int_t buffersize = 4000;
//Char_t branchname[15];
- AliDetector::MakeBranch(option);
+ AliDetector::MakeBranch(option,file);
//Char_t *r = strstr(option,"R");
//sprintf(branchname,"%srecPoints",GetName());
//if (fRecPoints && gAlice->TreeR() && r) {
- // gAlice->TreeR()->Branch(branchname,fRecPoints->IsA()->GetName()
- // ,&fRecPoints,buffersize,0);
- // printf("* AliTRD::MakeBranch * Making Branch %s for points in TreeR\n",branchname);
+ // MakeBranchInTree(gAlice->TreeR(),
+ // branchname, &fRecPoints,buffersize, file) ;
//}
}
#include "AliDetector.h"
+class TFile;
+
class AliRun;
class AliDigit;
TObjArray *RecPoints() const { return fRecPoints; };
virtual void Init();
virtual Int_t IsVersion() const = 0;
- virtual void MakeBranch(Option_t* option);
+ virtual void MakeBranch(Option_t* option, char *file=0);
virtual void ResetRecPoints();
virtual void StepManager() = 0;
virtual void SetTreeAddress();
virtual Int_t GetSensSector() const = 0;
virtual Int_t GetSensSectorRange() const = 0;
+ virtual void SDigits2Digits();
+
virtual AliTRDsim *CreateTR() = 0;
virtual AliTRDsim *GetTR() const = 0;
/*
$Log$
+Revision 1.5 2000/11/01 14:53:20 cblume
+Merge with TRD-develop
+
Revision 1.1.2.4 2000/10/17 02:27:34 cblume
Get rid of global constants
return 0;
}
-
-//______________________________________________________________________________
-void AliTRDdigit::Streamer(TBuffer &R__b)
-{
- //
- // Stream an object of class AliTRDdigit.
- //
-
- if (R__b.IsReading()) {
- Version_t R__v = R__b.ReadVersion(); if (R__v) { }
- AliDigitNew::Streamer(R__b);
- R__b >> fRow;
- R__b >> fCol;
- R__b >> fTime;
- }
- else {
- R__b.WriteVersion(AliTRDdigit::IsA());
- AliDigitNew::Streamer(R__b);
- R__b << fRow;
- R__b << fCol;
- R__b << fTime;
- }
-
-}
/*
$Log$
+Revision 1.17 2000/12/08 12:53:27 cblume
+Change in Copy() function for HP-compiler
+
Revision 1.16 2000/12/07 12:20:46 cblume
Go back to array compression. Use sampled PRF to speed up digitization
printf("AliTRDdigitizer::WriteDigits -- ");
printf("Write the digits tree %s for event %d.\n"
,treeName,fEvent);
- gAlice->TreeD()->Write(treeName,2);
+ gAlice->TreeD()->Write(treeName,TObject::kOverwrite);
return kTRUE;
/*
$Log$
+Revision 1.9 2000/11/02 09:25:53 cblume
+Change also the dictionary to AliTRDdataArray
+
Revision 1.8 2000/11/01 15:20:13 cblume
Change AliTRDdataArrayI to AliTRDdataArray in MakeBranch()
// AliTRDdataArray objects. //
// //
///////////////////////////////////////////////////////////////////////////////
+#include <iostream.h>
+#include <TROOT.h>
#include <TTree.h>
+#include <TFile.h>
#include "AliRun.h"
}
//_____________________________________________________________________________
-Bool_t AliTRDdigitsManager::MakeBranch()
+Bool_t AliTRDdigitsManager::MakeBranch(char *file)
{
//
// Creates the branches for the digits and the dictionary in the digits tree
Bool_t status = kTRUE;
+ //TFile *file = (TFile*)gROOT->GetListOfFiles()->FindObject("TRD.Digits.root");
+
if (gAlice->TreeD()) {
// Make the branch for the digits
if (fDigits) {
- //const AliTRDdataArrayI *kDigits =
- // (AliTRDdataArrayI *) fDigits->At(0);
const AliTRDdataArray *kDigits =
(AliTRDdataArray *) fDigits->At(0);
if (kDigits) {
- gAlice->TreeD()->Branch("TRDdigits",kDigits->IsA()->GetName()
- ,&kDigits,buffersize,1);
+ gAlice->MakeBranchInTree(gAlice->TreeD(),
+ "TRDdigits", kDigits->IsA()->GetName(),
+ &kDigits,buffersize, 1,file) ;
printf("AliTRDdigitsManager::MakeBranch -- ");
printf("Making branch TRDdigits\n");
}
Char_t branchname[15];
sprintf(branchname,"TRDdictionary%d",iDict);
if (fDictionary[iDict]) {
- //const AliTRDdataArrayI *kDictionary =
- // (AliTRDdataArrayI *) fDictionary[iDict]->At(0);
const AliTRDdataArray *kDictionary =
(AliTRDdataArray *) fDictionary[iDict]->At(0);
if (kDictionary) {
- gAlice->TreeD()->Branch(branchname,kDictionary->IsA()->GetName()
- ,&kDictionary,buffersize,1);
+ gAlice->MakeBranchInTree(gAlice->TreeD(),
+ branchname,kDictionary->IsA()->GetName(),
+ &kDictionary,buffersize, 1,file) ;
printf("AliTRDdigitsManager::MakeBranch -- ");
printf("Making branch %s\n",branchname);
- }
+ }
else {
status = kFALSE;
- }
+ }
}
else {
status = kFALSE;
#include <TObject.h>
+class TFile;
+
class AliTRDsegmentArray;
class AliTRDdataArrayI;
class AliTRDdigit;
AliTRDdigitsManager &operator=(const AliTRDdigitsManager &m);
virtual void Copy(TObject &m);
- virtual Bool_t MakeBranch();
+ virtual Bool_t MakeBranch(char *file=0);
virtual Bool_t ReadDigits();
virtual Bool_t WriteDigits();
/*
$Log$
+Revision 1.5 2000/11/01 14:53:21 cblume
+Merge with TRD-develop
+
Revision 1.1.2.2 2000/09/18 13:41:29 cblume
Changed fDetector to UShort and fQ to Short_t. Use customized streamer
//
}
-
-//_____________________________________________________________________________
-void AliTRDhit::Streamer(TBuffer &R__b)
-{
- //
- // Stream an object of class AliTRDhit.
- //
-
- if (R__b.IsReading()) {
- Version_t R__v = R__b.ReadVersion(); if (R__v) { }
- AliHit::Streamer(R__b);
- R__b >> fDetector;
- R__b >> fQ;
- }
- else {
- R__b.WriteVersion(AliTRDhit::IsA());
- AliHit::Streamer(R__b);
- R__b << fDetector;
- R__b << fQ;
- }
-
-}
/*
$Log$
+Revision 1.7 2000/11/20 08:56:07 cblume
+Cleanup of data arrays
+
Revision 1.6 2000/11/01 14:53:21 cblume
Merge with TRD-develop
}
//_____________________________________________________________________________
-void AliTRDsegmentArrayBase::MakeTree()
+void AliTRDsegmentArrayBase::MakeTree(char *file)
{
//
// Create a tree for the segment
fTree = new TTree("Segment Tree","Tree with segments");
fBranch = fTree->Branch("Segment",psegment->IsA()->GetName(),&psegment,64000,1);
+ if (file)
+ fBranch->SetFile(file);
delete psegment;
virtual Bool_t ConnectTree(const char *treeName);
Bool_t MakeArray(Int_t n);
virtual AliTRDsegmentID *NewSegment();
- virtual void MakeTree();
+ virtual void MakeTree(char *file = 0);
virtual AliTRDsegmentID *LoadSegment(Int_t index);
virtual AliTRDsegmentID *LoadEntry(Int_t index);
virtual void StoreSegment(Int_t index);
/*
$Log$
+Revision 1.7 2000/12/20 13:00:45 cblume
+Modifications for the HP-compiler
+
Revision 1.6 2000/12/12 10:20:10 cblume
Initialize fSepctrum = 0 in ctors
return 0;
}
-
-//_____________________________________________________________________________
-void AliTRDsim::Streamer(TBuffer &R__b)
-{
- //
- // Stream an object of class AliTRDsim.
- //
-
- if (R__b.IsReading()) {
- Version_t R__v = R__b.ReadVersion(); if (R__v) { }
- TObject::Streamer(R__b);
- R__b >> fNFoils;
- R__b >> fFoilThick;
- R__b >> fGapThick;
- R__b >> fFoilDens;
- R__b >> fGapDens;
- R__b >> fFoilOmega;
- R__b >> fGapOmega;
- R__b >> fFoilZ;
- R__b >> fGapZ;
- R__b >> fFoilA;
- R__b >> fGapA;
- R__b >> fTemp;
- R__b >> fSpNBins;
- R__b >> fSpRange;
- R__b >> fSpBinWidth;
- R__b >> fSpLower;
- R__b >> fSpUpper;
- R__b.ReadArray(fSigma);
- R__b >> fSpectrum;
- }
- else {
- R__b.WriteVersion(AliTRDsim::IsA());
- TObject::Streamer(R__b);
- R__b << fNFoils;
- R__b << fFoilThick;
- R__b << fGapThick;
- R__b << fFoilDens;
- R__b << fGapDens;
- R__b << fFoilOmega;
- R__b << fGapOmega;
- R__b << fFoilZ;
- R__b << fGapZ;
- R__b << fFoilA;
- R__b << fGapA;
- R__b << fTemp;
- R__b << fSpNBins;
- R__b << fSpRange;
- R__b << fSpBinWidth;
- R__b << fSpLower;
- R__b << fSpUpper;
- R__b.WriteArray(fSigma, fSpNBins);
- R__b << (TObject*) fSpectrum;
- }
-
-}
#pragma link off all classes;
#pragma link off all functions;
-#pragma link C++ class AliTRD;
-#pragma link C++ class AliTRDv0;
-#pragma link C++ class AliTRDv1;
-#pragma link C++ class AliTRDhit-;
-#pragma link C++ class AliTRDdigit-;
-#pragma link C++ class AliTRDdigitsManager;
-#pragma link C++ class AliTRDpixel;
-#pragma link C++ class AliTRDmatrix;
-#pragma link C++ class AliTRDgeometry;
-#pragma link C++ class AliTRDgeometryFull;
-#pragma link C++ class AliTRDgeometryHole;
-#pragma link C++ class AliTRDdigitizer;
-#pragma link C++ class AliTRDclusterizer;
-#pragma link C++ class AliTRDclusterizerV0;
-#pragma link C++ class AliTRDclusterizerV1;
-#pragma link C++ class AliTRDrecPoint;
-#pragma link C++ class AliTRDsegmentArray;
-#pragma link C++ class AliTRDdataArray;
-#pragma link C++ class AliTRDdataArrayI;
-#pragma link C++ class AliTRDdataArrayF;
-#pragma link C++ class AliTRDsim-;
-#pragma link C++ class AliTRDpoints;
-#pragma link C++ class AliTRDtimeBin;
-#pragma link C++ class AliTRDtrackingSector;
+#pragma link C++ class AliTRD+;
+#pragma link C++ class AliTRDv0+;
+#pragma link C++ class AliTRDv1+;
+#pragma link C++ class AliTRDhit+;
+#pragma link C++ class AliTRDdigit+;
+#pragma link C++ class AliTRDdigitsManager+;
+#pragma link C++ class AliTRDpixel+;
+#pragma link C++ class AliTRDmatrix+;
+#pragma link C++ class AliTRDgeometry+;
+#pragma link C++ class AliTRDgeometryFull+;
+#pragma link C++ class AliTRDgeometryHole+;
+#pragma link C++ class AliTRDdigitizer+;
+#pragma link C++ class AliTRDclusterizer+;
+#pragma link C++ class AliTRDclusterizerV0+;
+#pragma link C++ class AliTRDclusterizerV1+;
+#pragma link C++ class AliTRDrecPoint+;
+#pragma link C++ class AliTRDsegmentArray+;
+#pragma link C++ class AliTRDdataArray+;
+#pragma link C++ class AliTRDdataArrayI+;
+#pragma link C++ class AliTRDdataArrayF+;
+#pragma link C++ class AliTRDsim+;
+#pragma link C++ class AliTRDpoints+;
+#pragma link C++ class AliTRDtimeBin+;
+#pragma link C++ class AliTRDtrackingSector+;
#pragma link C++ class AliTRDtrack-;
-#pragma link C++ class AliTRDtracker;
-#pragma link C++ class AliTRDcluster;
+#pragma link C++ class AliTRDtracker+;
+#pragma link C++ class AliTRDcluster+;
-#pragma link C++ class AliTRDsegmentID;
-#pragma link C++ class AliTRDsegmentArrayBase;
-#pragma link C++ class AliTRDarrayI;
-#pragma link C++ class AliTRDarrayF;
+#pragma link C++ class AliTRDsegmentID+;
+#pragma link C++ class AliTRDsegmentArrayBase+;
+#pragma link C++ class AliTRDarrayI+;
+#pragma link C++ class AliTRDarrayF+;
#endif
/*
$Log$
+Revision 1.14 2000/12/12 13:17:01 coppedis
+Minor corrections suggested by P. Hristov
+
Revision 1.12 2000/12/01 08:19:01 coppedis
Adding a message error if ZDC is constructed without DIPO
// --- ROOT system
#include <TBRIK.h>
#include <TNode.h>
-#include "TGeometry.h"
-#include "TTree.h"
+#include <TGeometry.h>
+#include <TFile.h>
+#include <TTree.h>
// --- AliRoot header files
#include "AliZDC.h"
fNhits = 0;
fNStHits = 0;
-
fStHits = new TClonesArray("AliZDCHit",1000);
-
fNPrimaryHits = 0;
}
/*
$Log$
+Revision 1.11 2001/01/16 07:43:33 hristov
+Initialisation of ZDC hits
+
Revision 1.10 2000/12/14 15:20:02 coppedis
Hits2Digits method for digitization
return ADCch;
}
-//_____________________________________________________________________________
-void AliZDCv1::Hits2Digits(Int_t ntracks)
+
+//____________________________________________________________________________
+void AliZDCv1::FinishEvent()
{
- // Creation of the digits from hits
+// Code moved to Hits2SDigits();
+}
- if(fDigits!=0) fDigits->Clear();
- else fDigits = new TClonesArray ("AliZDCDigit",1000);
+//_____________________________________________________________________________
+void AliZDCv1::SDigits2Digits()
+{
+ Hits2Digits(gAlice->GetNtrack());
+}
- char branchname[10];
- sprintf(branchname,"%s",GetName());
- gAlice->TreeD()->Branch(branchname,&fDigits, fBufferSize);
-
- gAlice->TreeD()->GetEvent(0);
-
+//_____________________________________________________________________________
+void AliZDCv1::Hits2Digits(Int_t ntracks)
+{
AliZDCDigit *newdigit;
AliZDCHit *hit;
}
//_____________________________________________________________________________
- void AliZDCv1::MakeBranch(Option_t *opt)
+ void AliZDCv1::MakeBranch(Option_t *opt, char *file)
{
//
// Create a new branch in the current Root Tree
AliDetector::MakeBranch(opt);
- char branchname[10];
+ Char_t branchname[10];
sprintf(branchname,"%s",GetName());
char *cD = strstr(opt,"D");
if (fDigits && gAlice->TreeD() && cD) {
- gAlice->TreeD()->Branch(branchname,&fDigits, fBufferSize);
+
+ // Creation of the digits from hits
+
+ if(fDigits!=0) fDigits->Clear();
+ else fDigits = new TClonesArray ("AliZDCDigit",1000);
+ char branchname[10];
+ sprintf(branchname,"%s",GetName());
+ gAlice->MakeBranchInTree(gAlice->TreeD(),
+ branchname, &fDigits, fBufferSize, file) ;
printf("* AliZDCv1::MakeBranch * Making Branch %s for digits\n\n",branchname);
}
}
virtual void CreateZDC();
virtual void CreateMaterials();
Int_t Digitize(Int_t Det, Int_t Quad, Int_t Light);
- virtual void MakeBranch(Option_t* opt);
+ virtual void FinishEvent();
+ virtual void SDigits2Digits();
+ virtual void MakeBranch(Option_t* opt, char *file=0);
virtual Int_t IsVersion() const {return 1;}
virtual void DrawModule();
virtual void Init();
#pragma link off all classes;
#pragma link off all functions;
-#pragma link C++ class AliZDC;
-#pragma link C++ class AliZDCv1;
-#pragma link C++ class AliZDCHit;
-#pragma link C++ class AliZDCDigit;
-#pragma link C++ class AliGenZDC;
+#pragma link C++ class AliZDC+;
+#pragma link C++ class AliZDCv1+;
+#pragma link C++ class AliZDCHit+;
+#pragma link C++ class AliZDCDigit+;
+#pragma link C++ class AliGenZDC+;
#endif
void Config()
{
-
-new AliGeant3("C++ Interface to Geant3");
-
-//=======================================================================
-// Create the output file
-
-TFile *rootfile = new TFile("galice.root","recreate");
-rootfile->SetCompressionLevel(2);
-TGeant3 *geant3 = (TGeant3*)gMC;
-//
-// Set External decayer
- AliDecayer* decayer = new AliDecayerPythia();
- decayer->SetForceDecay(all);
- decayer->Init();
- gMC->SetExternalDecayer(decayer);
-//
-//
-//=======================================================================
-// ******* GEANT STEERING parameters FOR ALICE SIMULATION *******
-geant3->SetTRIG(1); //Number of events to be processed
-geant3->SetSWIT(4,10);
-geant3->SetDEBU(0,0,1);
-//geant3->SetSWIT(2,2);
-geant3->SetDCAY(1);
-geant3->SetPAIR(1);
-geant3->SetCOMP(1);
-geant3->SetPHOT(1);
-geant3->SetPFIS(0);
-geant3->SetDRAY(0);
-geant3->SetANNI(1);
-geant3->SetBREM(1);
-geant3->SetMUNU(1);
-geant3->SetCKOV(1);
-geant3->SetHADR(1); //Select pure GEANH (HADR 1) or GEANH/NUCRIN (HADR 3)
-geant3->SetLOSS(2);
-geant3->SetMULS(1);
-geant3->SetRAYL(1);
-geant3->SetAUTO(1); //Select automatic STMIN etc... calc. (AUTO 1) or manual (AUTO 0)
-geant3->SetABAN(0); //Restore 3.16 behaviour for abandoned tracks
-geant3->SetOPTI(2); //Select optimisation level for GEANT geometry searches (0,1,2)
-geant3->SetERAN(5.e-7);
-
-Float_t cut = 1.e-3; // 1MeV cut by default
-Float_t tofmax = 1.e10;
-// GAM ELEC NHAD CHAD MUON EBREM MUHAB EDEL MUDEL MUPA TOFMAX
-geant3->SetCUTS(cut,cut, cut, cut, cut, cut, cut, cut, cut, cut, tofmax);
-//
-//=======================================================================
-// ************* STEERING parameters FOR ALICE SIMULATION **************
-// --- Specify event type to be tracked through the ALICE setup
-// --- All positions are in cm, angles in degrees, and P and E in GeV
-AliGenHIJINGpara *gener = new AliGenHIJINGpara(50);
-gener->SetMomentumRange(0,999);
-gener->SetPhiRange(0,360);
-gener->SetThetaRange(10,170);
-gener->SetOrigin(0,0,0); //vertex position
-gener->SetSigma(0,0,0); //Sigma in (X,Y,Z) (cm) on IP position
-gener->Init();
-//
-// Activate this line if you want the vertex smearing to happen
-// track by track
-//
-//gener->SetVertexSmear(perTrack);
-
-gAlice->SetField(-999,2); //Specify maximum magnetic field in Tesla (neg. ==> default field)
-
-Int_t iMAG=1;
-Int_t iITS=1;
-Int_t iTPC=1;
-Int_t iTOF=1;
-Int_t iRICH=1;
-Int_t iZDC=0;
-Int_t iCASTOR=1;
-Int_t iTRD=1;
-Int_t iABSO=1;
-Int_t iDIPO=1;
-Int_t iHALL=1;
-Int_t iFRAME=1;
-Int_t iSHIL=1;
-Int_t iPIPE=1;
-Int_t iFMD=1;
-Int_t iMUON=1;
-Int_t iPHOS=1;
-Int_t iPMD=1;
-Int_t iSTART=0;
-
-//=================== Alice BODY parameters =============================
-AliBODY *BODY = new AliBODY("BODY","Alice envelop");
-
-
-if(iMAG) {
-//=================== MAG parameters ============================
-// --- Start with Magnet since detector layouts may be depending ---
-// --- on the selected Magnet dimensions ---
-AliMAG *MAG = new AliMAG("MAG","Magnet");
-}
-
-
-if(iABSO) {
-//=================== ABSO parameters ============================
-AliABSO *ABSO = new AliABSOv0("ABSO","Muon Absorber");
-}
-
-if(iDIPO) {
-//=================== DIPO parameters ============================
-
-AliDIPO *DIPO = new AliDIPOv2("DIPO","Dipole version 2");
-}
-
-if(iHALL) {
-//=================== HALL parameters ============================
-
-AliHALL *HALL = new AliHALL("HALL","Alice Hall");
-}
-
-
-if(iFRAME) {
-//=================== FRAME parameters ============================
-
-AliFRAME *FRAME = new AliFRAMEv1("FRAME","Space Frame");
-
-}
-
-if(iSHIL) {
-//=================== SHIL parameters ============================
-
-AliSHIL *SHIL = new AliSHILv0("SHIL","Shielding");
-}
-
-
-if(iPIPE) {
-//=================== PIPE parameters ============================
-
-AliPIPE *PIPE = new AliPIPEv0("PIPE","Beam Pipe");
-}
-
-
-if(iITS) {
-//=================== ITS parameters ============================
-//
-// EUCLID is a flag to output (=1) both geometry and media to two ASCII files
-// (called by default ITSgeometry.euc and ITSgeometry.tme) in a format
-// understandable to the CAD system EUCLID. The default (=0) means that you
-// dont want to use this facility.
-//
-AliITS *ITS = new AliITSv5("ITS","normal ITS");
-ITS->SetEUCLID(0);
-}
-
-
-if(iTPC) {
-//============================ TPC parameters ================================
-// --- This allows the user to specify sectors for the SLOW (TPC geometry 2)
-// --- Simulator. SecAL (SecAU) <0 means that ALL lower (upper)
-// --- sectors are specified, any value other than that requires at least one
-// --- sector (lower or upper)to be specified!
-// --- Reminder: sectors 1-24 are lower sectors (1-12 -> z>0, 13-24 -> z<0)
-// --- sectors 25-72 are the upper ones (25-48 -> z>0, 49-72 -> z<0)
-// --- SecLows - number of lower sectors specified (up to 6)
-// --- SecUps - number of upper sectors specified (up to 12)
-// --- Sens - sensitive strips for the Slow Simulator !!!
-// --- This does NOT work if all S or L-sectors are specified, i.e.
-// --- if SecAL or SecAU < 0
-//
-//
-//-----------------------------------------------------------------------------
-
- // gROOT->LoadMacro("SetTPCParam.C");
- // AliTPCParam *param = SetTPCParam();
- AliTPC *TPC = new AliTPCv1("TPC","Default"); //v1 is default
- // TPC->SetParam(param); // pass the parameter object to the TPC
-
-// set gas mixture
-
- //TPC->SetGasMixt(2,20,10,-1,0.9,0.1,0.);
- //TPC->SetSecAL(4);
- //TPC->SetSecAU(4);
- //TPC->SetSecLows(1, 2, 3, 19, 20, 21);
- //TPC->SetSecUps(37, 38, 39, 37+18, 38+18, 39+18, -1, -1, -1, -1, -1, -1);
- //TPC->SetSens(1);
-
- //if (TPC->IsVersion()==1) param->Write(param->GetTitle());
-}
-
-if(iTOF) {
-//=================== TOF parameters ============================
-AliTOF *TOF = new AliTOFv1("TOF","normal TOF");
-}
-
-if(iRICH) {
-//=================== RICH parameters ===========================
+ // 7-DEC-2000 09:00
+ // Switch on Transition Radiation simulation. 6/12/00 18:00
+ // iZDC=1 7/12/00 09:00
+ // ThetaRange is (0., 180.). It was (0.28,179.72) 7/12/00 09:00
+
+ new AliGeant3("C++ Interface to Geant3");
+
+ if (!gSystem->Getenv("CONFIG_FILE")) {
+ TFile *rootfile = new TFile("galice.root","recreate");
+ rootfile->SetCompressionLevel(2);
+ }
+
+ TGeant3 *geant3 = (TGeant3*)gMC;
+ //
+ // Set External decayer
+ AliDecayer* decayer = new AliDecayerPythia();
+ decayer->SetForceDecay(all);
+ decayer->Init();
+ gMC->SetExternalDecayer(decayer);
+ //
+ //
+ //=======================================================================
+ // ******* GEANT STEERING parameters FOR ALICE SIMULATION *******
+ geant3->SetTRIG(1); //Number of events to be processed
+ geant3->SetSWIT(4,10);
+ geant3->SetDEBU(0,0,1);
+ //geant3->SetSWIT(2,2);
+ geant3->SetDCAY(1);
+ geant3->SetPAIR(1);
+ geant3->SetCOMP(1);
+ geant3->SetPHOT(1);
+ geant3->SetPFIS(0);
+ geant3->SetDRAY(0);
+ geant3->SetANNI(1);
+ geant3->SetBREM(1);
+ geant3->SetMUNU(1);
+ geant3->SetCKOV(1);
+ geant3->SetHADR(1); //Select pure GEANH (HADR 1) or GEANH/NUCRIN (HADR 3)
+ geant3->SetLOSS(2);
+ geant3->SetMULS(1);
+ geant3->SetRAYL(1);
+ geant3->SetAUTO(1); //Select automatic STMIN etc... calc. (AUTO 1) or manual (AUTO 0)
+ geant3->SetABAN(0); //Restore 3.16 behaviour for abandoned tracks
+ geant3->SetOPTI(2); //Select optimisation level for GEANT geometry searches (0,1,2)
+ geant3->SetERAN(5.e-7);
+
+ Float_t cut = 1.e-3; // 1MeV cut by default
+ Float_t tofmax = 1.e10;
+ // GAM ELEC NHAD CHAD MUON EBREM MUHAB EDEL MUDEL MUPA TOFMAX
+ geant3->SetCUTS(cut,cut, cut, cut, cut, cut, cut, cut, cut, cut, tofmax);
+ //
+ //=======================================================================
+ // ************* STEERING parameters FOR ALICE SIMULATION **************
+ // --- Specify event type to be tracked through the ALICE setup
+ // --- All positions are in cm, angles in degrees, and P and E in GeV
+ if (gSystem->Getenv("CONFIG_NPARTICLES")) {
+ int nParticles = atoi(gSystem->Getenv("CONFIG_NPARTICLES"));
+ } else {
+ int nParticles = 50;
+ }
+ AliGenHIJINGpara *gener = new AliGenHIJINGpara(nParticles);
+
+ gener->SetMomentumRange(0,999);
+ gener->SetPhiRange(0,360);
+ // gener->SetThetaRange(0.28,179.72);
+ gener->SetThetaRange(0.,180.);
+ gener->SetOrigin(0,0,0); //vertex position
+ gener->SetSigma(0,0,0); //Sigma in (X,Y,Z) (cm) on IP position
+ gener->Init();
+ //
+ // Activate this line if you want the vertex smearing to happen
+ // track by track
+ //
+ //gener->SetVertexSmear(perTrack);
+
+ gAlice->SetField(-999,2); //Specify maximum magnetic field in Tesla (neg. ==> default field)
+
+ Int_t iABSO=1;
+ Int_t iCASTOR=1;
+ Int_t iDIPO=1;
+ Int_t iFMD=1;
+ Int_t iFRAME=1;
+ Int_t iHALL=1;
+ Int_t iITS=1;
+ Int_t iMAG=1;
+ Int_t iMUON=1;
+ Int_t iPHOS=1;
+ Int_t iPIPE=1;
+ Int_t iPMD=1;
+ Int_t iRICH=1;
+ Int_t iSHIL=1;
+ Int_t iSTART=1;
+ Int_t iTOF=1;
+ Int_t iTPC=1;
+ Int_t iTRD=1;
+ Int_t iZDC=1;
+
+ //=================== Alice BODY parameters =============================
+ AliBODY *BODY = new AliBODY("BODY","Alice envelop");
+
+
+ if(iMAG) {
+ //=================== MAG parameters ============================
+ // --- Start with Magnet since detector layouts may be depending ---
+ // --- on the selected Magnet dimensions ---
+ AliMAG *MAG = new AliMAG("MAG","Magnet");
+ }
+
+
+ if(iABSO) {
+ //=================== ABSO parameters ============================
+ AliABSO *ABSO = new AliABSOv0("ABSO","Muon Absorber");
+ }
+
+ if(iDIPO) {
+ //=================== DIPO parameters ============================
+
+ AliDIPO *DIPO = new AliDIPOv2("DIPO","Dipole version 2");
+ }
+
+ if(iHALL) {
+ //=================== HALL parameters ============================
+
+ AliHALL *HALL = new AliHALL("HALL","Alice Hall");
+ }
+
+
+ if(iFRAME) {
+ //=================== FRAME parameters ============================
+
+ AliFRAME *FRAME = new AliFRAMEv1("FRAME","Space Frame");
+
+ }
+
+ if(iSHIL) {
+ //=================== SHIL parameters ============================
+
+ AliSHIL *SHIL = new AliSHILv0("SHIL","Shielding");
+ }
+
+
+ if(iPIPE) {
+ //=================== PIPE parameters ============================
+
+ AliPIPE *PIPE = new AliPIPEv0("PIPE","Beam Pipe");
+ }
+
+
+ if(iITS) {
+ //=================== ITS parameters ============================
+ //
+ // As the innermost detector in ALICE, the Inner Tracking System "impacts" on
+ // almost all other detectors. This involves the fact that the ITS geometry
+ // still has several options to be followed in parallel in order to determine
+ // the best set-up which minimizes the induced background. All the geometries
+ // available to date are described in the following. Read carefully the comments
+ // and use the default version (the only one uncommented) unless you are making
+ // comparisons and you know what you are doing. In this case just uncomment the
+ // ITS geometry you want to use and run Aliroot.
+ //
+ // Detailed geometries:
+ // ====================
+ //
+ //
+ //AliITS *ITS = new AliITSv3("ITS","Old ITS detailed version as of the ALICE TP");
+ //
+ //AliITS *ITS = new AliITSv5("ITS","Current ITS detailed version used for the ITS TDR");
+ //
+ //AliITS *ITS = new AliITSv5symm("ITS","Updated ITS TDR detailed version with symmetric services");
+ //
+ AliITS *ITS = new AliITSv5asymm("ITS","Updates ITS TDR detailed version with asymmetric services");
+ //
+ //
+ // Coarse geometries (warning: no hits are produced with these coarse geometries and they unuseful for reconstruction !):
+ // ======================================================================================================================
+ //
+ //
+ //AliITS *ITS = new AliITSv1("ITS","Old ITS coarse version as of the ALICE TP");
+ //
+ //AliITS *ITS = new AliITSvPPRcoarseasymm("ITS","New ITS coarse version with asymmetric services");
+ //
+ //AliITS *ITS = new AliITSvPPRcoarsesymm("ITS","New ITS coarse version with symmetric services");
+ //
+ //
+ // Geant3 <-> EUCLID conversion
+ // ============================
+ //
+ // SetEUCLID is a flag to output (=1) or not to output (=0) both geometry and
+ // media to two ASCII files (called by default ITSgeometry.euc and
+ // ITSgeometry.tme) in a format understandable to the CAD system EUCLID.
+ // The default (=0) means that you dont want to use this facility.
+ //
+ ITS->SetEUCLID(0);
+ }
+
+
+ if(iTPC) {
+ //============================ TPC parameters ================================
+ // --- This allows the user to specify sectors for the SLOW (TPC geometry 2)
+ // --- Simulator. SecAL (SecAU) <0 means that ALL lower (upper)
+ // --- sectors are specified, any value other than that requires at least one
+ // --- sector (lower or upper)to be specified!
+ // --- Reminder: sectors 1-24 are lower sectors (1-12 -> z>0, 13-24 -> z<0)
+ // --- sectors 25-72 are the upper ones (25-48 -> z>0, 49-72 -> z<0)
+ // --- SecLows - number of lower sectors specified (up to 6)
+ // --- SecUps - number of upper sectors specified (up to 12)
+ // --- Sens - sensitive strips for the Slow Simulator !!!
+ // --- This does NOT work if all S or L-sectors are specified, i.e.
+ // --- if SecAL or SecAU < 0
+ //
+ //
+ //-----------------------------------------------------------------------------
+
+ // gROOT->LoadMacro("SetTPCParam.C");
+ // AliTPCParam *param = SetTPCParam();
+ AliTPC *TPC = new AliTPCv2("TPC","Default");
+ // All sectors included
+ TPC->SetSecAL(-1);
+ TPC->SetSecAU(-1);
+
+ }
+
+ if(iTOF) {
+ //=================== TOF parameters ============================
+ AliTOF *TOF = new AliTOFv2("TOF","normal TOF");
+ }
+
+ if(iRICH) {
+ //=================== RICH parameters ===========================
AliRICH *RICH = new AliRICHv1("RICH","normal RICH");
-}
+ }
-if(iZDC) {
-//=================== ZDC parameters ============================
+ if(iZDC) {
+ //=================== ZDC parameters ============================
-AliZDC *ZDC = new AliZDCv1("ZDC","normal ZDC");
-}
+ AliZDC *ZDC = new AliZDCv1("ZDC","normal ZDC");
+ }
-if(iCASTOR) {
-//=================== CASTOR parameters ============================
+ if(iCASTOR) {
+ //=================== CASTOR parameters ============================
-AliCASTOR *CASTOR = new AliCASTORv1("CASTOR","normal CASTOR");
-}
+ AliCASTOR *CASTOR = new AliCASTORv1("CASTOR","normal CASTOR");
+ }
-if(iTRD) {
-//=================== TRD parameters ============================
+ if(iTRD) {
+ //=================== TRD parameters ============================
- AliTRD *TRD = new AliTRDv0("TRD","TRD fast simulator");
- //TRD->SetHits();
+ AliTRD *TRD = new AliTRDv1("TRD","TRD slow simulator");
- //AliTRD *TRD = new AliTRDv1("TRD","TRD slow simulator");
- //TRD->SetSensPlane(0);
- //TRD->SetSensChamber(2);
- //TRD->SetSensSector(17);
+ // Select the gas mixture (0: 97% Xe + 3% isobutane, 1: 90% Xe + 10% CO2)
+ TRD->SetGasMix(1);
- // Select the gas mixture (0: 97% Xe + 3% isobutane, 1: 90% Xe + 10% CO2)
- TRD->SetGasMix(1);
-
- // With hole in front of PHOS
- TRD->SetPHOShole();
- // With hole in front of RICH
- TRD->SetRICHhole();
-}
-
-if(iFMD) {
-//=================== FMD parameters ============================
-
-AliFMD *FMD = new AliFMDv1("FMD","normal FMD");
-}
-
-if(iMUON) {
-//=================== MUON parameters ===========================
-
-AliMUON *MUON = new AliMUONv0("MUON","normal MUON");
+ // With hole in front of PHOS
+ TRD->SetPHOShole();
+ // With hole in front of RICH
+ TRD->SetRICHhole();
+ // Switch on TR
+ AliTRDsim *TRDsim = TRD->CreateTR();
+ }
+
+ if(iFMD) {
+ //=================== FMD parameters ============================
+
+ AliFMD *FMD = new AliFMDv1("FMD","normal FMD");
+ }
+
+ if(iMUON) {
+ //=================== MUON parameters ===========================
+
+ AliMUON *MUON = new AliMUONv1("MUON","normal MUON");
+ MUON->SetIshunt(0);
+ MUON->SetMaxStepGas(0.1);
+ MUON->SetMaxStepAlu(0.1);
+ //
+ // Version 0
+ //
+ // First define the number of planes that are segmented (1 or 2) by a call
+ // to SetNsec.
+ // Then chose for each chamber (chamber plane) the segmentation
+ // and response model.
+ // They should be equal for the two chambers of each station. In a future
+ // version this will be enforced.
+ //
+ //
+ Int_t chamber;
+ Int_t station;
+ // Default response
+ AliMUONResponseV0* response0 = new AliMUONResponseV0;
+ response0->SetSqrtKx3(0.7131);
+ response0->SetKx2(1.0107);
+ response0->SetKx4(0.4036);
+ response0->SetSqrtKy3(0.7642);
+ response0->SetKy2(0.9706);
+ response0->SetKy4(0.3831);
+ response0->SetPitch(0.25);
+ response0->SetSigmaIntegration(10.);
+ response0->SetChargeSlope(50);
+ response0->SetChargeSpread(0.18, 0.18);
+ response0->SetMaxAdc(4096);
+ response0->SetZeroSuppression(6);
+ //--------------------------------------------------------
+ // Configuration for Chamber TC1/2 (Station 1) ----------
+ //^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ Float_t rseg1[4]={17.5, 55.2, 71.3, 95.5};
+ Int_t nseg1[4]={4, 4, 2, 1};
+ //
+ chamber=1;
+ //^^^^^^^^^
+ MUON->SetNsec(chamber-1,2);
+ //
+ AliMUONSegmentationV01 *seg11=new AliMUONSegmentationV01;
+
+ seg11->SetSegRadii(rseg1);
+ seg11->SetPadSize(3, 0.5);
+ seg11->SetDAnod(3.0/3./4);
+ seg11->SetPadDivision(nseg1);
+
+ MUON->SetSegmentationModel(chamber-1, 1, seg11);
+ //
+ AliMUONSegmentationV02 *seg12=new AliMUONSegmentationV02;
+ seg12->SetSegRadii(rseg1);
+ seg12->SetPadSize(0.75, 2.0);
+ seg12->SetDAnod(3.0/3./4);
+ seg12->SetPadDivision(nseg1);
+
+ MUON->SetSegmentationModel(chamber-1, 2, seg12);
+
+ MUON->SetResponseModel(chamber-1, response0);
+
+ chamber=2;
+ //^^^^^^^^^
+ //
+ MUON->SetNsec(chamber-1,2);
+ //
+ AliMUONSegmentationV01 *seg21=new AliMUONSegmentationV01;
+ seg21->SetSegRadii(rseg1);
+ seg21->SetPadSize(3, 0.5);
+ seg21->SetDAnod(3.0/3./4);
+ seg21->SetPadDivision(nseg1);
+ MUON->SetSegmentationModel(chamber-1, 1, seg21);
+ //
+ AliMUONSegmentationV02 *seg22=new AliMUONSegmentationV02;
+ seg22->SetSegRadii(rseg1);
+ seg22->SetPadSize(0.75, 2.);
+ seg22->SetDAnod(3.0/3./4);
+ seg22->SetPadDivision(nseg1);
+ MUON->SetSegmentationModel(chamber-1, 2, seg22);
+
+ MUON->SetResponseModel(chamber-1, response0);
+ //
+ //--------------------------------------------------------
+ // Configuration for Chamber TC3/4 -----------------------
+ ///^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ // Float_t rseg2[4]={23.5, 87.7, 122.4, 122.5};
+ Float_t rseg2[4]={23.5, 47.1, 87.7, 122.5};
+ Int_t nseg2[4]={4, 4, 2, 1};
+ //
+ chamber=3;
+ //^^^^^^^^^
+ MUON->SetNsec(chamber-1,2);
+ //
+ AliMUONSegmentationV01 *seg31=new AliMUONSegmentationV01;
+ seg31->SetSegRadii(rseg2);
+ seg31->SetPadSize(6, 0.5);
+ seg31->SetDAnod(3.0/3./4);
+ seg31->SetPadDivision(nseg2);
+ MUON->SetSegmentationModel(chamber-1, 1, seg31);
+ //
+ AliMUONSegmentationV02 *seg32=new AliMUONSegmentationV02;
+ seg32->SetSegRadii(rseg2);
+ seg32->SetPadSize(0.75, 4.);
+ seg32->SetPadDivision(nseg2);
+ seg32->SetDAnod(3.0/3./4);
+
+ MUON->SetSegmentationModel(chamber-1, 2, seg32);
+
+ MUON->SetResponseModel(chamber-1, response0);
+
+ chamber=4;
+ //^^^^^^^^^
+ //
+ MUON->SetNsec(chamber-1,2);
+ //
+ AliMUONSegmentationV01 *seg41=new AliMUONSegmentationV01;
+ seg41->SetSegRadii(rseg2);
+ seg41->SetPadSize(6, 0.5);
+ seg41->SetDAnod(3.0/3./4);
+ seg41->SetPadDivision(nseg2);
+ MUON->SetSegmentationModel(chamber-1, 1, seg41);
+ //
+ AliMUONSegmentationV02 *seg42=new AliMUONSegmentationV02;
+ seg42->SetSegRadii(rseg2);
+ seg42->SetPadSize(0.75, 4.);
+ seg42->SetPadDivision(nseg2);
+ seg42->SetDAnod(3.0/3./4);
+
+ MUON->SetSegmentationModel(chamber-1, 2, seg42);
+
+ MUON->SetResponseModel(chamber-1, response0);
+
+
+ //--------------------------------------------------------
+ // Configuration for Chamber TC5/6 -----------------------
+ //^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+ seg5 = new AliMUONSegmentationV1;
+ AliMUONResponseV0* response5 = new AliMUONResponseV0;
+ // K3 = 0.62
+ response5->SetSqrtKx3(0.78740079);
+ response5->SetKx2(0.95237319); // 0.5 * kPI * (1- 0.5*sqrtky3 )
+ response5->SetKx4(0.37480633); // 0.25/TMath::ATan(sqrtkx3)
+ // K3 = 0.55
+ response5->SetSqrtKy3(0.74161985);
+ response5->SetKy2(0.98832946);
+ response5->SetKy4(0.39177817);
+ response5->SetPitch(0.325);
+ response5->SetSigmaIntegration(10.);
+ response5->SetChargeSlope(50);
+ response5->SetChargeSpread(0.4, 0.4);
+ response5->SetMaxAdc(4096);
+ response5->SetZeroSuppression(6);
+
-}
+ chamber=5;
+ MUON->SetNsec(chamber-1,1);
+ MUON->SetSegmentationModel(chamber-1, 1, seg5);
+ MUON->SetResponseModel(chamber-1, response5);
+
+ chamber=6;
+ MUON->SetNsec(chamber-1,1);
+ MUON->SetSegmentationModel(chamber-1, 1, seg5);
+ MUON->SetResponseModel(chamber-1, response5);
+ //
+ // Station 3
+ station=3;
+ MUON->SetPadSize(station, 1, 0.975, 0.55);
+
+ //--------------------------------------------------------
+ // Configuration for Chamber TC7/8 (Station 4) ----------
+ //^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+ Int_t nseg4[4]={4, 4, 2, 1};
+
+ chamber=7;
+ //^^^^^^^^^
+ MUON->SetNsec(chamber-1,2);
+ //
+ AliMUONSegmentationV04 *seg71=new AliMUONSegmentationV04;
+ seg71->SetPadSize(10.,0.5);
+ seg71->SetDAnod(0.25);
+ seg71->SetPadDivision(nseg4);
+ MUON->SetSegmentationModel(chamber-1, 1, seg71);
+ AliMUONSegmentationV05 *seg72=new AliMUONSegmentationV05;
+ seg72->SetPadSize(1,10);
+ seg72->SetDAnod(0.25);
+ seg72->SetPadDivision(nseg4);
+ MUON->SetSegmentationModel(chamber-1, 2, seg72);
+
+ MUON->SetResponseModel(chamber-1, response0);
+
+ chamber=8;
+ //^^^^^^^^^
+ MUON->SetNsec(chamber-1,2);
+ AliMUONSegmentationV04 *seg81=new AliMUONSegmentationV04;
+ seg81->SetPadSize(10., 0.5);
+ seg81->SetPadDivision(nseg4);
+ seg81->SetDAnod(0.25);
+ MUON->SetSegmentationModel(chamber-1, 1, seg81);
+
+ AliMUONSegmentationV05 *seg82=new AliMUONSegmentationV05;
+ seg82->SetPadSize(1, 10);
+ seg82->SetPadDivision(nseg4);
+ seg82->SetDAnod(0.25);
+ MUON->SetSegmentationModel(chamber-1, 2, seg82);
+
+ MUON->SetResponseModel(chamber-1, response0);
+ //--------------------------------------------------------
+ // Configuration for Chamber TC9/10 (Station 5) ---------
+ //^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ chamber=9;
+ //^^^^^^^^^
+ MUON->SetNsec(chamber-1,2);
+ //
+ AliMUONSegmentationV04 *seg91=new AliMUONSegmentationV04;
+ seg91->SetPadSize(10.,0.5);
+ seg91->SetDAnod(0.25);
+ seg91->SetPadDivision(nseg4);
+ MUON->SetSegmentationModel(chamber-1, 1, seg91);
+
+ AliMUONSegmentationV05 *seg92=new AliMUONSegmentationV05;
+ seg92->SetPadSize(1,10);
+ seg92->SetDAnod(0.25);
+ seg92->SetPadDivision(nseg4);
+
+ MUON->SetSegmentationModel(chamber-1, 2, seg92);
+
+ MUON->SetResponseModel(chamber-1, response0);
+
+ chamber=10;
+ //^^^^^^^^^
+ MUON->SetNsec(chamber-1,2);
+ AliMUONSegmentationV04 *seg101=new AliMUONSegmentationV04;
+ seg101->SetPadSize(10., 0.5);
+ seg101->SetPadDivision(nseg4);
+ seg101->SetDAnod(0.25);
+ MUON->SetSegmentationModel(chamber-1, 1, seg101);
+
+ AliMUONSegmentationV05 *seg102=new AliMUONSegmentationV05;
+ seg102->SetPadSize(1,10);
+ seg102->SetPadDivision(nseg4);
+ seg102->SetDAnod(0.25);
+ MUON->SetSegmentationModel(chamber-1, 2, seg102);
+
+ MUON->SetResponseModel(chamber-1, response0);
+
+ //--------------------------------------------------------
+ // Configuration for Trigger staions ---------------------
+ //^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ AliMUONResponseTrigger* responseTrigger0 = new AliMUONResponseTrigger;
+
+ chamber=11;
+ MUON->SetNsec(chamber-1,2);
+ AliMUONSegmentationTriggerX *seg111=new AliMUONSegmentationTriggerX;
+ MUON->SetSegmentationModel(chamber-1, 1, seg111);
+ AliMUONSegmentationTriggerY *seg112=new AliMUONSegmentationTriggerY;
+ MUON->SetSegmentationModel(chamber-1, 2, seg112);
+
+ MUON->SetResponseModel(chamber-1, responseTrigger0);
+
+ chamber=12;
+ MUON->SetNsec(chamber-1,2);
+ AliMUONSegmentationTriggerX *seg121=new AliMUONSegmentationTriggerX;
+ MUON->SetSegmentationModel(chamber-1, 1, seg121);
+ AliMUONSegmentationTriggerY *seg122=new AliMUONSegmentationTriggerY;
+ MUON->SetSegmentationModel(chamber-1, 2, seg122);
+
+ MUON->SetResponseModel(chamber-1, responseTrigger0);
+
+ chamber=13;
+ MUON->SetNsec(chamber-1,2);
+ AliMUONSegmentationTriggerX *seg131=new AliMUONSegmentationTriggerX;
+ MUON->SetSegmentationModel(chamber-1, 1, seg131);
+ AliMUONSegmentationTriggerY *seg132=new AliMUONSegmentationTriggerY;
+ MUON->SetSegmentationModel(chamber-1, 2, seg132);
+ MUON->SetResponseModel(chamber-1, responseTrigger0);
+
+ chamber=14;
+ MUON->SetNsec(chamber-1,2);
+ AliMUONSegmentationTriggerX *seg141=new AliMUONSegmentationTriggerX;
+ MUON->SetSegmentationModel(chamber-1, 1, seg141);
+ AliMUONSegmentationTriggerY *seg142=new AliMUONSegmentationTriggerY;
+ MUON->SetSegmentationModel(chamber-1, 2, seg142);
+
+ MUON->SetResponseModel(chamber-1, responseTrigger0);
+ }
-//=================== PHOS parameters ===========================
+ //=================== PHOS parameters ===========================
-if(iPHOS) {
- AliPHOS *PHOS = new AliPHOSv1("PHOS","GPS2");
-}
+ if(iPHOS) {
+ AliPHOS *PHOS = new AliPHOSv1("PHOS","GPS2");
+ }
-if(iPMD) {
-//=================== PMD parameters ============================
+ if(iPMD) {
+ //=================== PMD parameters ============================
-AliPMD *PMD = new AliPMDv0("PMD","normal PMD");
-PMD->SetPAR(1., 1., 0.8, 0.02);
-PMD->SetIN(6., 18., -580., 27., 27.);
-PMD->SetGEO(0.0, 0.2, 4.);
-PMD->SetPadSize(0.8, 1.0, 1.0, 1.5);
+ AliPMD *PMD = new AliPMDv1("PMD","normal PMD");
+ PMD->SetPAR(1., 1., 0.8, 0.02);
+ PMD->SetIN(6., 18., -580., 27., 27.);
+ PMD->SetGEO(0.0, 0.2, 4.);
+ PMD->SetPadSize(0.8, 1.0, 1.0, 1.5);
-}
+ }
-if(iSTART) {
-//=================== START parameters ============================
-AliSTART *START = new AliSTARTv1("START","START Detector");
-}
+ if(iSTART) {
+ //=================== START parameters ============================
+ AliSTART *START = new AliSTARTv1("START","START Detector");
+ }
}
+