/*
$Log$
+Revision 1.7 2002/10/23 07:43:00 alibrary
+Introducing some effective C++ suggestions
+
Revision 1.6 2002/10/22 15:02:15 alibrary
Introducing Riostream.h
}
//____________________________________________________________________________
-AliConfig::AliConfig(const AliConfig&):
+AliConfig::AliConfig(const AliConfig& conf):
+ TNamed(conf),
fTopFolder(0),
fTasks(0),
fPDGFolder(0),
}
//____________________________________________________________________________
-void AliConfig::AddInFolder (char *dir, TObject *obj)
+void AliConfig::AddInFolder (const char *dir, TObject *obj)
{
TFolder *folder =
dynamic_cast<TFolder *>(fTopFolder->FindObject(dir));
}
//____________________________________________________________________________
-TObject* AliConfig::FindInFolder (char *dir, const char *name)
+TObject* AliConfig::FindInFolder (const char *dir, const char *name)
{
if(!name) return(fTopFolder->FindObject(name));
TFolder * folder = dynamic_cast<TFolder *>(fTopFolder->FindObject(dir));
while ((obj = next ()))
{
TString dir(obj->GetName());
- TString path = dir + "/" + token;
- TString macro = path + ".C";
+ TString tpath = dir + "/" + token;
+ TString macro = tpath + ".C";
if (!gSystem->AccessPathName (macro.Data())) {
gInterpreter->ExecuteMacro (macro.Data());
found = "(" + macro + ")";
}
break;
} else {
- TString macroDefault = path + "/Default.C";
+ TString macroDefault = tpath + "/Default.C";
if (!gSystem->AccessPathName (macroDefault.Data())) {
gInterpreter->ExecuteMacro (macroDefault.Data());
found = "(" + macro + ")";
- TString macroConfigure = path + "/Configure.C";
+ TString macroConfigure = tpath + "/Configure.C";
if (!gSystem->AccessPathName (macroConfigure.Data())) {
gInterpreter->ExecuteMacro (macroConfigure.Data());
found += " => Configured";
/* $Id$ */
/*
* $Log$
+ * Revision 1.6 2002/10/22 15:02:15 alibrary
+ * Introducing Riostream.h
+ *
* Revision 1.5 2002/10/14 14:57:32 hristov
* Merging the VirtualMC branch to the main development branch (HEAD)
*
enum {kFolders=8, kTasks=5};
AliConfig(const char * name, const char * title);
AliConfig(const AliConfig&);
- void AddInFolder (char * dir, TObject *obj);
+ void AddInFolder (const char * dir, TObject *obj);
void AddSubFolder(char * dir[], TObject *obj);
void AddSubTask(char * dir[], TObject *obj);
- TObject* FindInFolder (char *dir, const char *name);
+ TObject* FindInFolder (const char *dir, const char *name);
AliConfig& operator = (const AliConfig&) {return *this;}
TFolder *fTopFolder;
AliTasks *fTasks;
// folders
- char* fPDGFolder ;
- char* fGeneratorFolder ;
- char* fMCFolder ;
- char* fModuleFolder ;
+ const char* fPDGFolder ;
+ const char* fGeneratorFolder ;
+ const char* fMCFolder ;
+ const char* fModuleFolder ;
char** fDetectorFolder ;
char** fDetectorTask ;
/*
$Log$
+Revision 1.2 2002/10/23 07:43:00 alibrary
+Introducing some effective C++ suggestions
+
Revision 1.1 2001/05/11 13:21:16 morsch
Geom. volume data class. Can be used during lego run for debugging.
//_______________________________________________________________________
-Bool_t AliDebugVolume::IsEqual(const char* name, const Int_t copy) const
+Bool_t AliDebugVolume::IsVEqual(const char* name, const Int_t copy) const
{
return (copy == fCopy && strcmp(name, fName) == 0);
}
char* Status() const;
- Bool_t IsEqual(const char* name, const Int_t copy) const;
+ Bool_t IsVEqual(const char* name, const Int_t copy) const;
private:
Int_t fCopy; //!Volume copy number
Float_t fStep; //!Stepsize to volume boundary
/*
$Log$
+Revision 1.22 2002/10/23 07:43:00 alibrary
+Introducing some effective C++ suggestions
+
Revision 1.21 2002/10/22 15:02:15 alibrary
Introducing Riostream.h
//
}
+//_______________________________________________________________________
+AliDetector::AliDetector(const AliDetector &det):
+ AliModule(det),
+ fTimeGate(200.e-9),
+ fIshunt(0),
+ fNhits(0),
+ fNdigits(0),
+ fBufferSize(1600),
+ fHits(0),
+ fDigits(0),
+ fDigitsFile(0),
+ fPoints(0),
+ fTrackReferences(0),
+ fMaxIterTrackRef(0),
+ fCurrentIterTrackRef(0)
+{
+ det.Copy(*this);
+}
+
//_____________________________________________________________________________
AliDetector::AliDetector(const char* name,const char *title):
AliModule(name,title),
//
// Register pointer to detector objects.
//
- TFolder *topFolder = (TFolder *)gROOT->FindObjectAny("/Folders");
+ TFolder *topFolder = dynamic_cast<TFolder *>(gROOT->FindObjectAny("/Folders"));
if (topFolder) {
- TFolder *folder = (TFolder *)topFolder->FindObjectAny(dir);
- // TFolder *folder = (TFolder *)gROOT->FindObjectAny(dir);
+ TFolder *folder = dynamic_cast<TFolder *>(topFolder->FindObjectAny(dir));
+ // TFolder *folder = dynamic_cast<TFolder *>(gROOT->FindObjectAny(dir));
if (!folder) {
cerr << "Cannot register: Missing folder: " << dir << endl;
} else {
- TFolder *subfolder = (TFolder *) folder->FindObjectAny(this->GetName());
+ TFolder *subfolder = dynamic_cast<TFolder *>(folder->FindObjectAny(this->GetName()));
if(!subfolder)
subfolder = folder->AddFolder(this->GetName(),this->GetTitle());
if (address) {
- TObject **obj = (TObject **) address;
+ TObject **obj = static_cast<TObject **>(address);
if ((*obj)->InheritsFrom(TCollection::Class())) {
- TCollection *collection = (TCollection *) (*obj);
+ TCollection *collection = dynamic_cast<TCollection *>(*obj);
if (name)
collection->SetName(name);
}
sprintf(outFile,"%s/%s",gAlice->GetBaseFile(),file);
branch->SetFile(outFile);
TIter next( branch->GetListOfBranches());
- while ((branch=(TBranch*)next())) {
+ while ((branch=dynamic_cast<TBranch*>(next()))) {
branch->SetFile(outFile);
}
delete outFile;
if (GetDebug()>1)
printf("* MakeBranch * Diverting Branch %s to file %s\n",name,file);
}
- char *folder = 0;
+ const char *folder = 0;
TString folderName(name);
if (!strncmp(tree->GetName(),"TreeE",5)) folder = "RunMC/Event/Data";
}
//_______________________________________________________________________
-void AliDetector::Copy(AliDetector &det) const
+void AliDetector::Copy(AliDetector &) const
{
//
// Copy *this onto det -- not implemented
//
- Fatal("Copy","Not implemented~\n");
+ Fatal("Copy","Not implemented\n");
}
//_______________________________________________________________________
//
if (!fTrackReferences) return;
for (Int_t i=0;i<fTrackReferences->GetEntries();i++){
- AliTrackReference * ref = (AliTrackReference*) fTrackReferences->UncheckedAt(i);
+ AliTrackReference * ref = dynamic_cast<AliTrackReference*>(fTrackReferences->UncheckedAt(i));
if (ref) {
Int_t newID = map[ref->GetTrack()];
if (newID>=0) ref->SetTrack(newID);
//
sMaxIterHit=fHits->GetEntriesFast();
sCurIterHit=0;
- if(sMaxIterHit) return (AliHit*) fHits->UncheckedAt(0);
+ if(sMaxIterHit) return dynamic_cast<AliHit*>(fHits->UncheckedAt(0));
else return 0;
}
//
fMaxIterTrackRef = fTrackReferences->GetEntriesFast();
fCurrentIterTrackRef = 0;
- if(fMaxIterTrackRef) return (AliTrackReference*) fTrackReferences->UncheckedAt(0);
+ if(fMaxIterTrackRef) return dynamic_cast<AliTrackReference*>(fTrackReferences->UncheckedAt(0));
else return 0;
}
//
if(sMaxIterHit) {
if(++sCurIterHit<sMaxIterHit)
- return (AliHit*) fHits->UncheckedAt(sCurIterHit);
+ return dynamic_cast<AliHit*>(fHits->UncheckedAt(sCurIterHit));
else
return 0;
} else {
//
if(fMaxIterTrackRef) {
if(++fCurrentIterTrackRef<fMaxIterTrackRef)
- return (AliTrackReference*) fTrackReferences->UncheckedAt(fCurrentIterTrackRef);
+ return dynamic_cast<AliTrackReference*>(fTrackReferences->UncheckedAt(fCurrentIterTrackRef));
else
return 0;
} else {
//
// Loop over all the hits and store their position
for (Int_t hit=0;hit<nhits;hit++) {
- ahit = (AliHit*)fHits->UncheckedAt(hit);
+ ahit = dynamic_cast<AliHit*>(fHits->UncheckedAt(hit));
trk=ahit->GetTrack();
assert(trk<=tracks);
if(ntrk[trk]==limi[trk]) {
// Creators - distructors
AliDetector(const char* name, const char *title);
AliDetector();
- AliDetector(const AliDetector &det) {det.Copy(*this);}
+ AliDetector(const AliDetector &det);
virtual ~AliDetector();
// Inline functions
/*
$Log$
+Revision 1.2 2000/02/14 11:44:29 fca
+New version from Y.Schutz
+
Revision 1.1 1999/12/17 09:01:14 fca
Y.Schutz new classes for reconstruction
ClassImp(AliDigitNew)
-AliDigitNew::AliDigitNew()
+//_______________________________________________________________________
+AliDigitNew::AliDigitNew():
+ fAmp(0),
+ fId(0),
+ fIndexInList(0)
{
+ //
+ // Default constructor
+ //
}
class AliDigitNew : public TObject {
public:
- AliDigitNew() ;
- ~AliDigitNew() {;}
+ AliDigitNew();
+ ~AliDigitNew() {}
Int_t GetAmp() const { return fAmp ; }
Int_t GetId() const { return fId ; }
Int_t GetIndexInList() const { return fIndexInList ; }
/*
$Log$
+Revision 1.6 2002/10/22 15:02:15 alibrary
+Introducing Riostream.h
+
Revision 1.5 2002/10/14 14:57:32 hristov
Merging the VirtualMC branch to the main development branch (HEAD)
ClassImp(AliDigitizer)
-AliDigitizer::AliDigitizer(const Text_t* name, const Text_t* title)
- :TTask(name,title)
+//_______________________________________________________________________
+AliDigitizer::AliDigitizer(const Text_t* name, const Text_t* title):
+ TTask(name,title),
+ fManager(0)
+
{
-//
-// dummy default ctor with name and title
-//
- fManager = 0;
+ //
+ // Default ctor with name and title
+ //
}
-AliDigitizer::AliDigitizer(AliRunDigitizer *manager,
- const Text_t* name, const Text_t* title)
- :TTask(name,title)
+//_______________________________________________________________________
+AliDigitizer::AliDigitizer(const AliDigitizer &dig):
+ TTask(dig.GetName(),dig.GetTitle()),
+ fManager(0)
{
-//
-// ctor with name and title
-//
- fManager = manager;
- manager->AddDigitizer(this);
+ //
+ // Copy ctor with
+ //
+ dig.Copy(*this);
+}
+
+//_______________________________________________________________________
+void AliDigitizer::Copy(AliDigitizer &) const
+{
+ Fatal("Copy","Not yet implemented\n");
}
+//_______________________________________________________________________
+AliDigitizer::AliDigitizer(AliRunDigitizer *manager,
+ const Text_t* name, const Text_t* title):
+ TTask(name,title),
+ fManager(manager)
+{
+ //
+ // ctor with name and title
+ //
+ fManager->AddDigitizer(this);
+}
+//_______________________________________________________________________
+AliDigitizer::~AliDigitizer()
+{
+ delete fManager;
+}
-AliDigitizer::~AliDigitizer() {;}
-////////////////////////////////////////////////////////////////////////
+//_______________________________________________________________________
Int_t AliDigitizer::GetNInputStreams() const
{
-//
-// return number of input streams
-//
+ //
+ // return number of input streams
+ //
Int_t nInputStreams = 0 ;
if (fManager)
nInputStreams = fManager->GetNinputs() ;
AliDigitizer(AliRunDigitizer *manager,
const Text_t* name="AliDigitizer",
const Text_t* title="AliDigitizer");
+// Copy ctor needed because there is a pointer
+ AliDigitizer(const AliDigitizer &dig);
+ AliDigitizer& operator=(AliDigitizer &dig)
+ {dig.Copy(*this);return *this;}
virtual ~AliDigitizer();
virtual Bool_t Init() {return kTRUE;}
// virtual void Digitize() = 0;
- protected:
+protected:
Int_t GetNInputStreams() const;
+ void Copy(AliDigitizer &dig) const;
AliRunDigitizer *fManager;
/*
$Log$
+Revision 1.19 2002/10/14 14:57:32 hristov
+Merging the VirtualMC branch to the main development branch (HEAD)
+
Revision 1.17.6.1 2002/06/10 14:43:06 hristov
Merged with v3-08-02
// //
//////////////////////////////////////////////////////////////////////////
-#include <TTree.h>
+#include <TArc.h>
#include <TButton.h>
#include <TCanvas.h>
-#include <TView.h>
+#include <TDiamond.h>
+#include <TGaxis.h>
+#include <TMath.h>
#include <TPaveLabel.h>
#include <TPaveText.h>
-#include <TDiamond.h>
-#include <TArc.h>
#include <TSlider.h>
#include <TSliderBox.h>
-#include <TGaxis.h>
+#include <TTree.h>
+#include <TView.h>
#include <TVirtualX.h>
-#include <TMath.h>
-#include "AliRun.h"
-#include "AliStack.h"
#include "AliDetector.h"
#include "AliDisplay.h"
+#include "AliHeader.h"
#include "AliPoints.h"
-#include "TParticle.h"
+#include "AliRun.h"
+#include "AliStack.h"
#include "TGeometry.h"
-#include "AliHeader.h"
+#include "TParticle.h"
static const Float_t kptcutmax = 2;
static const Float_t ketacutmax = 1.5;
ClassImp(AliDisplay)
-//_____________________________________________________________________________
-AliDisplay::AliDisplay()
+//_______________________________________________________________________
+AliDisplay::AliDisplay():
+ fZoomMode(0),
+ fDrawAllViews(0),
+ fDrawParticles(0),
+ fDrawHits(0),
+ fPTcut(0),
+ fTheta(0),
+ fPhi(0),
+ fPsi(0),
+ fRrange(0),
+ fZrange(0),
+ fZooms(0),
+ fHitsCuts(0),
+ fCanvas(0),
+ fTrigPad(0),
+ fCutPad(0),
+ fEtaPad(0),
+ fButtons(0),
+ fPad(0),
+ fCutSlider(0),
+ fEtaSlider(0),
+ fRangeSlider(0),
+ fPickButton(0),
+ fZoomButton(0),
+ fArcButton(0),
+ fFruits(0),
+ fTracksToDisplay(0),
+ fNTracksToDisplay(0)
{
//
// Default constructor
//
- fCanvas = 0;
- fTrigPad = 0;
- fCutPad = 0;
- fEtaPad = 0;
- fButtons = 0;
- fPad = 0;
- fCutSlider = 0;
- fEtaSlider = 0;
- fRangeSlider = 0;
- fPickButton = 0;
- fZoomButton = 0;
- fArcButton = 0;
- fFruits = 0;
- fTracksToDisplay =0;
- fNTracksToDisplay =0;
}
-//_____________________________________________________________________________
-AliDisplay::AliDisplay(Int_t size)
+//_______________________________________________________________________
+AliDisplay::AliDisplay(Int_t size):
+ fZoomMode(1),
+ fDrawAllViews(kFALSE),
+ fDrawParticles(kTRUE),
+ fDrawHits(kTRUE),
+ fPTcut(0),
+ fTheta(0),
+ fPhi(-90),
+ fPsi(0),
+ fRrange(0),
+ fZrange(0),
+ fZooms(1),
+ fHitsCuts(0),
+ fCanvas(0),
+ fTrigPad(0),
+ fCutPad(0),
+ fEtaPad(0),
+ fButtons(0),
+ fPad(0),
+ fCutSlider(0),
+ fEtaSlider(0),
+ fRangeSlider(0),
+ fPickButton(0),
+ fZoomButton(0),
+ fArcButton(0),
+ fFruits(0),
+ fTracksToDisplay(0),
+ fNTracksToDisplay(0)
{
-// Create an event display object.
-// A canvas named "edisplay" is created with a vertical size in pixels
-//
-// A QUICK Overview of the Event Display functions
-// ===============================================
-//
-// The event display can ve invoked by executing the macro "display.C"
-// A canvas like in the picture below will appear.
-//
-// On the left side of the canvas, the following buttons appear:
-// *Next* to move to the next event
-// *Previous* to move to the previous event
-// *Top View* to display a top view of the current event
-// *Side View* to display a side view of the current event
-// *Front View* to display a front view of the current event
-// *All Views* to display front/side/top/30-30 views of the current event
-// *OpenGL* to use OpenGl to view the current event.
-// Note that OpenGL cannot be used across the network.
-// Before using OpenGL, load the GL libraries
-// by executing the macro GL.C (in $ROOTSYS/macros/GL.C.
-// Once in GL, click the HELP button of the GL canvas.
-// *X3D* to use X3D to view the current event (Unix only).
-// Once in X3D, type M to see the list of all possible options.
-// for example type J to zoom, K to unzoom
-// use the mouse to rotate.
-// *Pick* Select this option to be able to point on a track with the
-// mouse. Once on the track, use the right button to select
-// an action. For example, select SetMarkerAttributes to
-// change the marker type/color/size for the track.
-// *Zoom* Select this option (default) if you want to zoom.
-// To zoom, simply select the selected area with the left button.
-// *UnZoom* To revert to the previous picture size.
-//
-// slider R On the left side, the vertical slider can be used to
-// set the default picture size.
-// slider pcut At the top of the canvas, a slider can be used to change
-// the momentum cut (or range) to display tracks.
-// slider eta On the right side of the canvas, a vertical slider can be used
-// to specify a rapidity range for the tracks.
-//
-// When you are in Zoom mode, you can click on the black part of the canvas
-// to select special options with the right mouse button.
-// This will display a pop-up menu with items like:
-// *Disable detector*
-// *Enable detector*, etc.
-// For example select "Disable detector". You get a dialog box.
-// Diable detector TRD for example.
-//
-// When you are in pick mode, you can "Inspect" the object pointed by the mouse.
-// When you are on a track, select the menu item "InspectParticle"
-// to display the current particle attributes.
-//
-// You can activate the Root browser by selecting the Inspect menu
-// in the canvas tool bar menu. Then select "Start Browser"
-// This will open a new canvas with the browser. At this point, you may want
-// to display some histograms (from the Trees). Go to the "File" menu
-// of the browser and click on "New canvas".
-// In the browser, click on item "ROOT files" in the left pane.
-// Click on galice.root.
-// Click on TH
-// Click on TPC for example
-// Click on any variable (eg TPC.fX) to histogram the variable.
-//
-// If you are lost, you can click on HELP in any Root canvas or browser.
-//Begin_Html
-/*
-<img src="picts/alidisplay.gif">
-*/
-//End_Html
-
- fPad = 0;
- gAlice->SetDisplay(this);
-
- // Initialize display default parameters
- SetRange();
- SetPTcut();
-
- // Set front view by default
- fTheta = 0;
- fPhi = -90;
- fPsi = 0;
- fDrawAllViews = kFALSE;
- fDrawHits = kTRUE;
- fDrawParticles = kTRUE;
- fZoomMode = 1;
- fZooms = 0;
- fHitsCuts = 0;
-
- // Create display canvas
- Int_t ysize = size;
- if (ysize < 100) ysize = 750;
- Int_t xsize = Int_t(size*830./ysize);
- fCanvas = new TCanvas("Canvas", "ALICE Event Display",14,47,xsize,ysize);
- fCanvas->ToggleEventStatus();
+ // Create an event display object.
+ // A canvas named "edisplay" is created with a vertical size in pixels
+ //
+ // A QUICK Overview of the Event Display functions
+ // ===============================================
+ //
+ // The event display can ve invoked by executing the macro "display.C"
+ // A canvas like in the picture below will appear.
+ //
+ // On the left side of the canvas, the following buttons appear:
+ // *Next* to move to the next event
+ // *Previous* to move to the previous event
+ // *Top View* to display a top view of the current event
+ // *Side View* to display a side view of the current event
+ // *Front View* to display a front view of the current event
+ // *All Views* to display front/side/top/30-30 views of the current event
+ // *OpenGL* to use OpenGl to view the current event.
+ // Note that OpenGL cannot be used across the network.
+ // Before using OpenGL, load the GL libraries
+ // by executing the macro GL.C (in $ROOTSYS/macros/GL.C.
+ // Once in GL, click the HELP button of the GL canvas.
+ // *X3D* to use X3D to view the current event (Unix only).
+ // Once in X3D, type M to see the list of all possible options.
+ // for example type J to zoom, K to unzoom
+ // use the mouse to rotate.
+ // *Pick* Select this option to be able to point on a track with the
+ // mouse. Once on the track, use the right button to select
+ // an action. For example, select SetMarkerAttributes to
+ // change the marker type/color/size for the track.
+ // *Zoom* Select this option (default) if you want to zoom.
+ // To zoom, simply select the selected area with the left button.
+ // *UnZoom* To revert to the previous picture size.
+ //
+ // slider R On the left side, the vertical slider can be used to
+ // set the default picture size.
+ // slider pcut At the top of the canvas, a slider can be used to change
+ // the momentum cut (or range) to display tracks.
+ // slider eta On the right side of the canvas, a vertical slider can be used
+ // to specify a rapidity range for the tracks.
+ //
+ // When you are in Zoom mode, you can click on the black part of the canvas
+ // to select special options with the right mouse button.
+ // This will display a pop-up menu with items like:
+ // *Disable detector*
+ // *Enable detector*, etc.
+ // For example select "Disable detector". You get a dialog box.
+ // Diable detector TRD for example.
+ //
+ // When you are in pick mode, you can "Inspect" the object pointed by the mouse.
+ // When you are on a track, select the menu item "InspectParticle"
+ // to display the current particle attributes.
+ //
+ // You can activate the Root browser by selecting the Inspect menu
+ // in the canvas tool bar menu. Then select "Start Browser"
+ // This will open a new canvas with the browser. At this point, you may want
+ // to display some histograms (from the Trees). Go to the "File" menu
+ // of the browser and click on "New canvas".
+ // In the browser, click on item "ROOT files" in the left pane.
+ // Click on galice.root.
+ // Click on TH
+ // Click on TPC for example
+ // Click on any variable (eg TPC.fX) to histogram the variable.
+ //
+ // If you are lost, you can click on HELP in any Root canvas or browser.
+ //Begin_Html
+ /*
+ <img src="picts/alidisplay.gif">
+ */
+ //End_Html
+
+ gAlice->SetDisplay(this);
- // Create main display pad
- fPad = new TPad("viewpad", "Alice display",0.15,0,0.97,0.96);
- fPad->Draw();
- fPad->Modified();
- fPad->SetFillColor(1);
- fPad->SetBorderSize(2);
-
- // Create user interface control pad
- DisplayButtons();
- fCanvas->cd();
-
- // Create Range and mode pad
- Float_t dxtr = 0.15;
- Float_t dytr = 0.45;
- fTrigPad = new TPad("trigger", "range and mode pad",0,0,dxtr,dytr);
- fTrigPad->Draw();
- fTrigPad->cd();
- fTrigPad->SetFillColor(22);
- fTrigPad->SetBorderSize(2);
- fRangeSlider = new TSlider("range","range",0.7,0.42,0.9,0.98);
- fRangeSlider->SetObject(this);
- char pickmode[] = "gAlice->Display()->SetPickMode()";
- Float_t db = 0.09;
- fPickButton = new TButton("Pick",pickmode,0.05,0.32,0.65,0.32+db);
- fPickButton->SetFillColor(38);
- fPickButton->Draw();
- char zoommode[] = "gAlice->Display()->SetZoomMode()";
- fZoomButton = new TButton("Zoom",zoommode,0.05,0.21,0.65,0.21+db);
- fZoomButton->SetFillColor(38);
- fZoomButton->Draw();
- fArcButton = new TArc(.8,fZoomButton->GetYlowNDC()+0.5*db,0.33*db);
- fArcButton->SetFillColor(kGreen);
- fArcButton->Draw();
- char butUnzoom[] = "gAlice->Display()->UnZoom()";
- TButton *button = new TButton("UnZoom",butUnzoom,0.05,0.05,0.95,0.15);
- button->SetFillColor(38);
- button->Draw();
- AppendPad(); // append display object as last object to force selection
-
- // Create momentum cut slider pad
- fCanvas->cd();
- fCutPad = new TPad("cutSlider", "pcut slider pad",dxtr,.96,1,1);
- fCutPad->Draw();
- fCutPad->cd();
- fCutPad->SetFillColor(22);
- fCutPad->SetBorderSize(2);
- fCutSlider = new TSlider("pcut","Momentum cut",0,0,1,1);
- fCutSlider->SetRange(fPTcut/kptcutmax,1);
- fCutSlider->SetObject(this);
- fCutSlider->SetFillColor(45);
- TSliderBox *sbox = (TSliderBox*)fCutSlider->GetListOfPrimitives()->First();
- sbox->SetFillColor(46);
- fCutSlider->cd();
- TGaxis *cutaxis = new TGaxis(0.02,0.8,0.98,0.8,0,kptcutmax,510,"");
- cutaxis->SetLabelSize(0.5);
- cutaxis->SetTitleSize(0.6);
- cutaxis->SetTitleOffset(0.5);
- cutaxis->SetTitle("pcut . ");
- fCutSlider->GetListOfPrimitives()->AddFirst(cutaxis);
-
- // Create rapidity cut slider pad
- fCanvas->cd();
- fEtaPad = new TPad("EtaSlider", "Eta slider pad",0.97,0,1,0.96);
- fEtaPad->Draw();
- fEtaPad->cd();
- fEtaPad->SetFillColor(22);
- fEtaPad->SetBorderSize(2);
- fEtaSlider = new TSlider("etacut","Rapidity cut",0,0,1,1);
- fEtaSlider->SetObject(this);
- fEtaSlider->SetFillColor(45);
- TSliderBox *sbox2 = (TSliderBox*)fEtaSlider->GetListOfPrimitives()->First();
- sbox2->SetFillColor(46);
- fEtaSlider->cd();
- TGaxis *etaaxis = new TGaxis(0.9,0.02,0.9,0.98,-ketacutmax,ketacutmax,510,"");
- etaaxis->SetLabelSize(0.5);
- etaaxis->SetTitleSize(0.6);
- etaaxis->SetTitleOffset(0.2);
- cutaxis->SetTitle("Etacut . ");
- fEtaSlider->GetListOfPrimitives()->AddFirst(etaaxis);
- fCanvas->cd();
-
- fTrigPad->SetEditable(kFALSE);
- fButtons->SetEditable(kFALSE);
- fTracksToDisplay =0;
- fNTracksToDisplay =0;
-
- fCanvas->cd();
- fCanvas->Update();
+ // Initialize display default parameters
+ SetRange();
+ SetPTcut();
+
+ // Set front view by default
+
+ // Create display canvas
+ Int_t ysize = size;
+ if (ysize < 100) ysize = 750;
+ Int_t xsize = Int_t(size*830./ysize);
+ fCanvas = new TCanvas("Canvas", "ALICE Event Display",14,47,xsize,ysize);
+ fCanvas->ToggleEventStatus();
+
+ // Create main display pad
+ fPad = new TPad("viewpad", "Alice display",0.15,0,0.97,0.96);
+ fPad->Draw();
+ fPad->Modified();
+ fPad->SetFillColor(1);
+ fPad->SetBorderSize(2);
+
+ // Create user interface control pad
+ DisplayButtons();
+ fCanvas->cd();
+
+ // Create Range and mode pad
+ Float_t dxtr = 0.15;
+ Float_t dytr = 0.45;
+ fTrigPad = new TPad("trigger", "range and mode pad",0,0,dxtr,dytr);
+ fTrigPad->Draw();
+ fTrigPad->cd();
+ fTrigPad->SetFillColor(22);
+ fTrigPad->SetBorderSize(2);
+
+ fRangeSlider = new TSlider("range","range",0.7,0.42,0.9,0.98);
+ fRangeSlider->SetObject(this);
+ char pickmode[] = "gAlice->Display()->SetPickMode()";
+ Float_t db = 0.09;
+
+ fPickButton = new TButton("Pick",pickmode,0.05,0.32,0.65,0.32+db);
+ fPickButton->SetFillColor(38);
+ fPickButton->Draw();
+ char zoommode[] = "gAlice->Display()->SetZoomMode()";
+ fZoomButton = new TButton("Zoom",zoommode,0.05,0.21,0.65,0.21+db);
+ fZoomButton->SetFillColor(38);
+ fZoomButton->Draw();
+ fArcButton = new TArc(.8,fZoomButton->GetYlowNDC()+0.5*db,0.33*db);
+ fArcButton->SetFillColor(kGreen);
+ fArcButton->Draw();
+ char butUnzoom[] = "gAlice->Display()->UnZoom()";
+ TButton *button = new TButton("UnZoom",butUnzoom,0.05,0.05,0.95,0.15);
+ button->SetFillColor(38);
+ button->Draw();
+ AppendPad(); // append display object as last object to force selection
+
+ // Create momentum cut slider pad
+ fCanvas->cd();
+ fCutPad = new TPad("cutSlider", "pcut slider pad",dxtr,.96,1,1);
+ fCutPad->Draw();
+ fCutPad->cd();
+ fCutPad->SetFillColor(22);
+ fCutPad->SetBorderSize(2);
+
+ fCutSlider = new TSlider("pcut","Momentum cut",0,0,1,1);
+ fCutSlider->SetRange(fPTcut/kptcutmax,1);
+ fCutSlider->SetObject(this);
+ fCutSlider->SetFillColor(45);
+ TSliderBox *sbox = dynamic_cast<TSliderBox*>(fCutSlider->GetListOfPrimitives()->First());
+ sbox->SetFillColor(46);
+ fCutSlider->cd();
+ TGaxis *cutaxis = new TGaxis(0.02,0.8,0.98,0.8,0,kptcutmax,510,"");
+ cutaxis->SetLabelSize(0.5);
+ cutaxis->SetTitleSize(0.6);
+ cutaxis->SetTitleOffset(0.5);
+ cutaxis->SetTitle("pcut . ");
+ fCutSlider->GetListOfPrimitives()->AddFirst(cutaxis);
+
+ // Create rapidity cut slider pad
+ fCanvas->cd();
+
+ fEtaPad = new TPad("EtaSlider", "Eta slider pad",0.97,0,1,0.96);
+ fEtaPad->Draw();
+ fEtaPad->cd();
+ fEtaPad->SetFillColor(22);
+ fEtaPad->SetBorderSize(2);
+
+ fEtaSlider = new TSlider("etacut","Rapidity cut",0,0,1,1);
+ fEtaSlider->SetObject(this);
+ fEtaSlider->SetFillColor(45);
+ TSliderBox *sbox2 = dynamic_cast<TSliderBox*>(fEtaSlider->GetListOfPrimitives()->First());
+ sbox2->SetFillColor(46);
+ fEtaSlider->cd();
+ TGaxis *etaaxis = new TGaxis(0.9,0.02,0.9,0.98,-ketacutmax,ketacutmax,510,"");
+ etaaxis->SetLabelSize(0.5);
+ etaaxis->SetTitleSize(0.6);
+ etaaxis->SetTitleOffset(0.2);
+ cutaxis->SetTitle("Etacut . ");
+ fEtaSlider->GetListOfPrimitives()->AddFirst(etaaxis);
+ fCanvas->cd();
+
+ fTrigPad->SetEditable(kFALSE);
+ fButtons->SetEditable(kFALSE);
+ fTracksToDisplay =0;
+ fNTracksToDisplay =0;
+
+ fCanvas->cd();
+ fCanvas->Update();
}
-//_____________________________________________________________________________
-AliDisplay::AliDisplay(const AliDisplay &disp)
+//_______________________________________________________________________
+AliDisplay::AliDisplay(const AliDisplay &disp):
+ TObject(disp),
+ fZoomMode(0),
+ fDrawAllViews(0),
+ fDrawParticles(0),
+ fDrawHits(0),
+ fPTcut(0),
+ fTheta(0),
+ fPhi(0),
+ fPsi(0),
+ fRrange(0),
+ fZrange(0),
+ fZooms(0),
+ fHitsCuts(0),
+ fCanvas(0),
+ fTrigPad(0),
+ fCutPad(0),
+ fEtaPad(0),
+ fButtons(0),
+ fPad(0),
+ fCutSlider(0),
+ fEtaSlider(0),
+ fRangeSlider(0),
+ fPickButton(0),
+ fZoomButton(0),
+ fArcButton(0),
+ fFruits(0),
+ fTracksToDisplay(0),
+ fNTracksToDisplay(0)
{
//
// Copy constructor
}
//_____________________________________________________________________________
-void AliDisplay::Copy(AliDisplay &disp) const
+void AliDisplay::Copy(AliDisplay &) const
{
//
// Copy *this onto disp -- not implemented
//
// Display track idx
//
- AliDetector *mTPC=(AliDetector*)gAlice->GetModule("TPC");
+ AliDetector *mTPC=dynamic_cast<AliDetector*>(gAlice->GetModule("TPC"));
TObjArray *points=mTPC->Points();
int ntracks=points->GetEntriesFast();
for (int track=0;track<ntracks;track++) {
- AliPoints *pm = (AliPoints*)points->UncheckedAt(track);
+ AliPoints *pm = dynamic_cast<AliPoints*>(points->UncheckedAt(track));
if (!pm) continue;
if (idx == pm->GetIndex()) {
pm->SetMarkerColor(2);
//
// Hide track on display
//
- AliDetector *mTPC=(AliDetector*)gAlice->GetModule("TPC");
+ AliDetector *mTPC=dynamic_cast<AliDetector*>(gAlice->GetModule("TPC"));
TObjArray *points=mTPC->Points();
int ntracks=points->GetEntriesFast();
for (int track=0;track<ntracks;track++) {
- AliPoints *pm = (AliPoints*)points->UncheckedAt(track);
+ AliPoints *pm = dynamic_cast<AliPoints*>(points->UncheckedAt(track));
if (!pm) continue;
if (idx == pm->GetIndex()) {
pm->SetMarkerColor(5);
{
// Disable detector name from graphics views
- AliModule *module = (AliModule*)gAlice->Modules()->FindObject(name);
+ AliModule *module = dynamic_cast<AliModule*>(gAlice->Modules()->FindObject(name));
if (!module) return;
module->Disable();
Draw();
TIter next(gAlice->Modules());
AliModule *module;
fHitsCuts = 0;
- while((module = (AliModule*)next())) {
+ while((module = dynamic_cast<AliModule*>(next()))) {
if (!module->IsActive()) continue;
points = module->Points();
if (!points) continue;
ntracks = points->GetEntriesFast();
for (track=0;track<ntracks;track++) {
- pm = (AliPoints*)points->UncheckedAt(track);
+ pm = dynamic_cast<AliPoints*>(points->UncheckedAt(track));
if (!pm) continue;
particle = pm->GetParticle();
if (!particle) continue;
{
// Draw current view using OPENGL
- TPad *pad = (TPad*)gPad->GetPadSave();
+ TPad *pad = dynamic_cast<TPad*>(gPad->GetPadSave());
pad->cd();
TView *view = pad->GetView();
if (!view) return;
{
// Draw current view using X3D
- TPad *pad = (TPad*)gPad->GetPadSave();
+ TPad *pad = dynamic_cast<TPad*>(gPad->GetPadSave());
pad->cd();
TView *view = pad->GetView();
if (!view) return;
{
// Enable detector name in graphics views
- AliModule *module = (AliModule*)gAlice->Modules()->FindObject(name);
+ AliModule *module = dynamic_cast<AliModule*>(gAlice->Modules()->FindObject(name));
if (!module) return;
module->Enable();
Draw();
for (Int_t track=0; track<fNTracksToDisplay;track++) {
gAlice->ResetHits();
gAlice->TreeH()->GetEvent(nprim-1-gAlice->GetPrimary(fTracksToDisplay[track]));
- while((module = (AliModule*)next())) {
+ while((module = dynamic_cast<AliModule*>(next()))) {
module->LoadPoints(nprim-1-gAlice->GetPrimary(fTracksToDisplay[track]));
}
next.Reset();
for (Int_t track=0; track<ntracks;track++) {
gAlice->ResetHits();
gAlice->TreeH()->GetEvent(track);
- while((module = (AliModule*)next())) {
+ while((module = dynamic_cast<AliModule*>(next()))) {
module->LoadPoints(track);
}
next.Reset();
//
if (fZooms <= 0) return;
fZooms--;
- TPad *pad = (TPad*)gPad->GetPadSave();
+ TPad *pad = dynamic_cast<TPad*>(gPad->GetPadSave());
pad->Range(fZoomX0[fZooms],fZoomY0[fZooms], fZoomX1[fZooms],fZoomY1[fZooms]);
pad->Modified();
}
$Log:
*/
-///////////////////////////////////////////////////////////////////////////////
-// //
-// //
-///////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////
+// //
+// //
+/////////////////////////////////////////////////////////////////////////
#include "Riostream.h"
ClassImp(AliESD)
-//__________________________________________________________________________
-AliESD::AliESD()
+//_______________________________________________________________________
+AliESD::AliESD():
+ fEventNumber(0),
+ fRunNumber(0),
+ fTrigger(0),
+ fRecoVersion(0),
+ fBitDDL(0),
+ fNSecVertex(0),
+ fNParticipants(0),
+ fNPartError(0),
+ fNElectron(0),
+ fNMuons(0),
+ fNPions(0),
+ fNKaons(0),
+ fNProtons(0),
+ fNPHOSPhotons(0),
+ fNPHOSNeutrons(0),
+ fNPHOSCCluster(0),
+ fNEMCALCluster(0),
+ fNPMDCluster(0),
+ fTMaxClusterEnergy(0),
+ fTMaxPCharged(0),
+ fNCharged(0),
+ fTotTranEnergy(0),
+ fESDVertex(),
+ fSecVertex(0),
+ fNonAssTrack(0),
+ fPhoton(0),
+ fNeutron(0),
+ fEMCALCluster(0),
+ fPMDCluster(0)
+{
+ Info("def ctor","Has been called\n");
+}
+
+//_______________________________________________________________________
+AliESD::AliESD(const AliESD &esd):
+ TObject(esd),
+ fEventNumber(0),
+ fRunNumber(0),
+ fTrigger(0),
+ fRecoVersion(0),
+ fBitDDL(0),
+ fNSecVertex(0),
+ fNParticipants(0),
+ fNPartError(0),
+ fNElectron(0),
+ fNMuons(0),
+ fNPions(0),
+ fNKaons(0),
+ fNProtons(0),
+ fNPHOSPhotons(0),
+ fNPHOSNeutrons(0),
+ fNPHOSCCluster(0),
+ fNEMCALCluster(0),
+ fNPMDCluster(0),
+ fTMaxClusterEnergy(0),
+ fTMaxPCharged(0),
+ fNCharged(0),
+ fTotTranEnergy(0),
+ fESDVertex(),
+ fSecVertex(0),
+ fNonAssTrack(0),
+ fPhoton(0),
+ fNeutron(0),
+ fEMCALCluster(0),
+ fPMDCluster(0)
{
- cout << "ESD def ctor" << endl;
}
ClassImp(AliESDVertex)
-//__________________________________________________________________________
-AliESDVertex::AliESDVertex()
+//_______________________________________________________________________
+AliESDVertex::AliESDVertex():
+ fNPrimary(0),
+ fCoordinates(3),
+ fErrorMatrix(6),
+ fPrimaryTracks(0),
+ fEffectiveMass(0),
+ fEffectiveMassError(0)
{
cout << "ESDVertex def ctor" << endl;
- fCoordinates.Set(3);
- fErrorMatrix.Set(6);
+}
+
+//_______________________________________________________________________
+AliESDVertex::AliESDVertex(const AliESDVertex &esdv):
+ TObject(esdv),
+ fNPrimary(0),
+ fCoordinates(0),
+ fErrorMatrix(0),
+ fPrimaryTracks(0),
+ fEffectiveMass(0),
+ fEffectiveMassError(0)
+{
}
ClassImp(AliESDTrack)
-//__________________________________________________________________________
-AliESDTrack::AliESDTrack()
+//_______________________________________________________________________
+AliESDTrack::AliESDTrack() :
+ fTrackID(0),
+ fPVertex(5),
+ fPEVertex(15),
+ fPFMeasPoint(6),
+ fPFMeasPointErr(15),
+ fPLMeasPoint(6),
+ fPLMeasPointErr(15),
+ fTrackLength(0),
+ fTrackLengthErr(0),
+ fStopVertex(0),
+ fNPointsITS(0),
+ fNPointsTPC(0),
+ fNPointsTRD(0),
+ fMeanResITS(0),
+ fMeanResTPC(0),
+ fMeanResTRD(0),
+ fGlobalChi2(0),
+ fParticleType(0),
+ fPIDprobPi(0),
+ fPIDprobK(0),
+ fPIDprobP(0),
+ fPIDprobE(0)
{
cout << "ESDTrack def ctor" << endl;
- fPVertex.Set(5);
- fPEVertex.Set(15);
- fPFMeasPoint.Set(6);
- fPFMeasPointErr.Set(15);
- fPLMeasPoint.Set(6);
- fPLMeasPointErr.Set(15);
}
+
+//_______________________________________________________________________
+AliESDTrack::AliESDTrack(const AliESDTrack &esdt):
+ TObject(esdt),
+ fTrackID(0),
+ fPVertex(0),
+ fPEVertex(0),
+ fPFMeasPoint(0),
+ fPFMeasPointErr(0),
+ fPLMeasPoint(0),
+ fPLMeasPointErr(0),
+ fTrackLength(0),
+ fTrackLengthErr(0),
+ fStopVertex(0),
+ fNPointsITS(0),
+ fNPointsTPC(0),
+ fNPointsTRD(0),
+ fMeanResITS(0),
+ fMeanResTPC(0),
+ fMeanResTRD(0),
+ fGlobalChi2(0),
+ fParticleType(0),
+ fPIDprobPi(0),
+ fPIDprobK(0),
+ fPIDprobP(0),
+ fPIDprobE(0)
+{
+}
+
Float_t fPIDprobE; // PID probability for e
private:
- AliESDTrack(const AliESDTrack &) {}
+ AliESDTrack(const AliESDTrack &);
AliESDTrack & operator=(const AliESDTrack &) {return (*this);}
ClassDef(AliESDTrack,1) //ESDTrack
Float_t fEffectiveMass; // Effective Mass
Float_t fEffectiveMassError; // Effective Mass Error
private:
- AliESDVertex(const AliESDVertex &) {}
+ AliESDVertex(const AliESDVertex &);
AliESDVertex & operator=(const AliESDVertex &) {return (*this);}
ClassDef(AliESDVertex,1) //ESDVertex
TObjArray fPMDCluster; // List of PMD clusters
private:
- AliESD(const AliESD &) {}
+ AliESD(const AliESD &);
AliESD & operator=(const AliESD &) {return (*this);}
ClassDef(AliESD,1) //ESD
/*
$Log$
+Revision 1.5 2002/10/14 14:57:32 hristov
+Merging the VirtualMC branch to the main development branch (HEAD)
+
Revision 1.3.6.1 2002/07/24 10:08:13 alibrary
Updating VirtualMC
ClassImp(AliFieldMap)
-//________________________________________
-AliFieldMap::AliFieldMap()
+//_______________________________________________________________________
+AliFieldMap::AliFieldMap():
+ fXbeg(0),
+ fYbeg(0),
+ fZbeg(0),
+ fXend(0),
+ fYend(0),
+ fZend(0),
+ fXdel(0),
+ fYdel(0),
+ fZdel(0),
+ fXdeli(0),
+ fYdeli(0),
+ fZdeli(0),
+ fXn(0),
+ fYn(0),
+ fZn(0),
+ fWriteEnable(0),
+ fB(0)
{
//
// Standard constructor
//
- fB = 0;
SetWriteEnable();
}
-AliFieldMap::AliFieldMap(const char *name, const char *title)
- : TNamed(name,title)
+//_______________________________________________________________________
+AliFieldMap::AliFieldMap(const char *name, const char *title):
+ TNamed(name,title),
+ fXbeg(0),
+ fYbeg(0),
+ fZbeg(0),
+ fXend(0),
+ fYend(0),
+ fZend(0),
+ fXdel(0),
+ fYdel(0),
+ fZdel(0),
+ fXdeli(0),
+ fYdeli(0),
+ fZdeli(0),
+ fXn(0),
+ fYn(0),
+ fZn(0),
+ fWriteEnable(0),
+ fB(0)
{
//
// Standard constructor
//
- fB = 0;
ReadField();
SetWriteEnable();
}
+//_______________________________________________________________________
AliFieldMap::~AliFieldMap()
{
-//
-// Destructor
-//
+ //
+ // Destructor
+ //
delete fB;
}
-//________________________________________
-AliFieldMap::AliFieldMap(const AliFieldMap &map)
+//_______________________________________________________________________
+AliFieldMap::AliFieldMap(const AliFieldMap &map):
+ TNamed(map),
+ fXbeg(0),
+ fYbeg(0),
+ fZbeg(0),
+ fXend(0),
+ fYend(0),
+ fZend(0),
+ fXdel(0),
+ fYdel(0),
+ fZdel(0),
+ fXdeli(0),
+ fYdeli(0),
+ fZdeli(0),
+ fXn(0),
+ fYn(0),
+ fZn(0),
+ fWriteEnable(0),
+ fB(0)
{
//
// Copy constructor
map.Copy(*this);
}
-//________________________________________
+//_______________________________________________________________________
void AliFieldMap::ReadField()
{
//
// Method to read the magnetic field map from file
//
FILE* magfile;
-// FILE* endf = fopen("end.table", "r");
-// FILE* out = fopen("out", "w");
+ // FILE* endf = fopen("end.table", "r");
+ // FILE* out = fopen("out", "w");
Int_t ix, iy, iz, ipx, ipy, ipz;
Float_t bx, by, bz;
Int_t nDim = fXn*fYn*fZn;
-// Float_t x,y,z,b;
+ // Float_t x,y,z,b;
fB = new TVector(3*nDim);
if (magfile) {
} // if mafile
}
+//_______________________________________________________________________
void AliFieldMap::Field(Float_t *x, Float_t *b)
{
-//
-// Use simple interpolation to obtain field at point x
-//
+ //
+ // Use simple interpolation to obtain field at point x
+ //
Double_t ratx, raty, ratz, hix, hiy, hiz, ratx1, raty1, ratz1,
bhyhz, bhylz, blyhz, blylz, bhz, blz, xl[3];
const Double_t kone=1;
Int_t ix, iy, iz;
b[0]=b[1]=b[2]=0;
-//
+ //
xl[0]=TMath::Abs(x[0])-fXbeg;
xl[1]=TMath::Abs(x[1])-fYbeg;
b[2] = blz *ratz1+bhz *ratz;
}
-//________________________________________
+//_______________________________________________________________________
void AliFieldMap::Copy(AliFieldMap & /* magf */) const
{
//
Fatal("Copy","Not implemented!\n");
}
-//________________________________________
+//_______________________________________________________________________
AliFieldMap & AliFieldMap::operator =(const AliFieldMap &magf)
{
magf.Copy(*this);
return *this;
}
+//_______________________________________________________________________
void AliFieldMap::Streamer(TBuffer &R__b)
{
// Stream an object of class AliFieldMap.
// Rep. Prog. Phys. 43 (1980) 1145-1189.
// M.Masera 15.03.2001 9:30 - modified on 26.02.2002 17:40
////////////////////////////////////////////////////////////////////////
+
#include <Riostream.h>
#include <TArrayD.h>
#include <TMatrixD.h>
ClassImp(AliGausCorr)
-//________________________________________________________
-AliGausCorr::AliGausCorr()
+//_______________________________________________________________________
+AliGausCorr::AliGausCorr():
+ fSize(0),
+ fCv(0)
{
+ //
// Default constructor
- fSize = 0;
- fCv = 0;
+ //
}
-//________________________________________________________
-AliGausCorr::AliGausCorr(const TMatrixD & vec, Int_t size)
+//_______________________________________________________________________
+AliGausCorr::AliGausCorr(const TMatrixD & vec, Int_t size):
+ fSize(size),
+ fCv(new TMatrixD(fSize,fSize))
{
+ //
// Standard constructor
- fSize = size;
- fCv = new TMatrixD(fSize,fSize);
+ //
for(Int_t j=0;j<fSize;j++){
double accum = 0;
for(Int_t k=0;k<j;k++){
}
}
-//________________________________________________________
-AliGausCorr::AliGausCorr(const AliGausCorr & tgcorr)
+//_______________________________________________________________________
+AliGausCorr::AliGausCorr(const AliGausCorr & tgcorr):
+ TObject(tgcorr),
+ fSize(tgcorr.fSize),
+ fCv(new TMatrixD(fSize,fSize))
{
+ //
// Copy contructor
-
- fSize = tgcorr.fSize;
- fCv = new TMatrixD(fSize,fSize);
+ //
for(Int_t i=0;i<fSize;i++){
for(Int_t j=0;j<fSize;j++)(*fCv)(i,j)=(*tgcorr.fCv)(i,j);
}
}
-//________________________________________________________
+//_______________________________________________________________________
AliGausCorr::~AliGausCorr()
{
// Destructor
delete fCv;
}
-//________________________________________________________
+//_______________________________________________________________________
void AliGausCorr::GetGaussN(TArrayD &vec) const
{
// return fSize correlated gaussian numbers
}
-//________________________________________________________
+//_______________________________________________________________________
void AliGausCorr::PrintCv() const
{
// Printout of the "square root" cov. matrix
printf("\n");
}
-//________________________________________________________
+//_______________________________________________________________________
AliGausCorr & AliGausCorr::operator=(const AliGausCorr & tgcorr)
{
if(&tgcorr != this && tgcorr.fSize!=fSize){
return *this;
}
-
-
-
-
-
/*
$Log$
+Revision 1.3 2001/10/16 07:44:38 morsch
+Initialize fVertex in all constructors.
+
Revision 1.2 2001/09/25 11:28:48 morsch
Possibility to store and retrieve primary vertex position added.
ClassImp(AliGenEventHeader)
-//_____________________________________________________________________________
-AliGenEventHeader::AliGenEventHeader()
+//_______________________________________________________________________
+AliGenEventHeader::AliGenEventHeader():
+ fNProduced(-1),
+ fImpactParameter(-1),
+ fVertex(3)
{
-// Constructor
- fNProduced = -1;
- fImpactParameter= -1.;
- fVertex.Set(3);
+ //
+ // Constructor
+ //
}
-
-AliGenEventHeader::AliGenEventHeader(const char * name)
- :TNamed(name, "Event Header")
+//_______________________________________________________________________
+AliGenEventHeader::AliGenEventHeader(const char * name):
+ TNamed(name, "Event Header"),
+ fNProduced(-1),
+ fImpactParameter(-1),
+ fVertex(3)
{
-// Constructor
- fNProduced = -1;
- fImpactParameter= -1.;
- fVertex.Set(3);
+ //
+ // Constructor
+ //
}
+//_______________________________________________________________________
void AliGenEventHeader::SetPrimaryVertex(const TArrayF &o)
{
//
fVertex[2]=o.At(2);
}
+//_______________________________________________________________________
void AliGenEventHeader::PrimaryVertex(TArrayF &o) const
{
//
/*
$Log$
+Revision 1.19 2002/03/12 11:06:03 morsch
+Add particle status code to argument list of SetTrack(..).
+
Revision 1.18 2002/02/18 19:23:00 hristov
Put protection in the destructor
//End_Html
// //
///////////////////////////////////////////////////////////////////
+#include "TGenerator.h"
+#include "AliConfig.h"
#include "AliGenerator.h"
-#include "TGenerator.h"
#include "AliRun.h"
-#include "AliConfig.h"
#include "AliStack.h"
-
ClassImp(AliGenerator)
TGenerator* AliGenerator::fgMCEvGen=0;
-//____________________________________________________________
-AliGenerator::AliGenerator()
+//_______________________________________________________________________
+AliGenerator::AliGenerator():
+ fThetaMin(0),
+ fThetaMax(0),
+ fPhiMin(0),
+ fPhiMax(0),
+ fPMin(0),
+ fPMax(0),
+ fPtMin(0),
+ fPtMax(0),
+ fYMin(0),
+ fYMax(0),
+ fVMin(3),
+ fVMax(3),
+ fNpart(0),
+ fParentWeight(0),
+ fChildWeight(0),
+ fAnalog(0),
+ fVertexSmear(kNoSmear),
+ fVertexSource(kExternal),
+ fCutVertexZ(0),
+ fTrackIt(0),
+ fOrigin(3),
+ fOsigma(3),
+ fVertex(3),
+ fEventVertex(0),
+ fStack(0)
{
//
// Default constructor
SetCutVertexZ();
- fOrigin.Set(3);
- fOsigma.Set(3);
- fVertex.Set(3);
-
fOrigin[0]=fOrigin[1]=fOrigin[2]=0;
fOsigma[0]=fOsigma[1]=fOsigma[2]=0;
fVertex[0]=fVertex[1]=fVertex[2]=0;
- fVMin.Set(3);
fVMin[0]=fVMin[1]=fVMin[2]=0;
- fVMax.Set(3);
fVMax[0]=fVMax[1]=fVMax[2]=10000;
- fStack = 0;
}
-//____________________________________________________________
-AliGenerator::AliGenerator(Int_t npart)
- : TNamed(" "," ")
+//_______________________________________________________________________
+AliGenerator::AliGenerator(Int_t npart):
+ fThetaMin(0),
+ fThetaMax(0),
+ fPhiMin(0),
+ fPhiMax(0),
+ fPMin(0),
+ fPMax(0),
+ fPtMin(0),
+ fPtMax(0),
+ fYMin(0),
+ fYMax(0),
+ fVMin(3),
+ fVMax(3),
+ fNpart(0),
+ fParentWeight(0),
+ fChildWeight(0),
+ fAnalog(0),
+ fVertexSmear(kNoSmear),
+ fVertexSource(kExternal),
+ fCutVertexZ(0),
+ fTrackIt(0),
+ fOrigin(3),
+ fOsigma(3),
+ fVertex(3),
+ fEventVertex(0),
+ fStack(0)
{
//
// Standard constructor
SetTrackingFlag();
SetCutVertexZ();
- fOrigin.Set(3);
- fOsigma.Set(3);
- fVertex.Set(3);
-
fOrigin[0]=fOrigin[1]=fOrigin[2]=0;
fOsigma[0]=fOsigma[1]=fOsigma[2]=0;
fVertex[0]=fVertex[1]=fVertex[2]=0;
- fVMin.Set(3);
fVMin[0]=fVMin[1]=fVMin[2]=0;
- fVMax.Set(3);
fVMax[0]=fVMax[1]=fVMax[2]=10000;
SetNumberParticles(npart);
AliConfig::Instance()->Add(this);
- fStack = 0;
}
-//____________________________________________________________
-AliGenerator::AliGenerator(const AliGenerator &gen) : TNamed(" "," ")
+//_______________________________________________________________________
+AliGenerator::AliGenerator(const AliGenerator &gen):
+ TNamed(gen),
+ AliRndm(gen),
+ fThetaMin(0),
+ fThetaMax(0),
+ fPhiMin(0),
+ fPhiMax(0),
+ fPMin(0),
+ fPMax(0),
+ fPtMin(0),
+ fPtMax(0),
+ fYMin(0),
+ fYMax(0),
+ fVMin(3),
+ fVMax(3),
+ fNpart(0),
+ fParentWeight(0),
+ fChildWeight(0),
+ fAnalog(0),
+ fVertexSmear(kNoSmear),
+ fVertexSource(kExternal),
+ fCutVertexZ(0),
+ fTrackIt(0),
+ fOrigin(3),
+ fOsigma(3),
+ fVertex(3),
+ fEventVertex(0),
+ fStack(0)
{
//
// Copy constructor
gen.Copy(*this);
}
-//____________________________________________________________
+//_______________________________________________________________________
AliGenerator & AliGenerator::operator=(const AliGenerator &gen)
{
//
return (*this);
}
-//____________________________________________________________
+//_______________________________________________________________________
void AliGenerator::Copy(AliGenerator &/* gen */) const
{
//
Fatal("Copy","Not implemented!\n");
}
-//____________________________________________________________
+//_______________________________________________________________________
AliGenerator::~AliGenerator()
{
//
}
}
+//_______________________________________________________________________
void AliGenerator::Init()
{
//
}
}
-
+//_______________________________________________________________________
void AliGenerator::VertexExternal()
{
// Dummy !!!!!!
fVertex[0]=fVertex[1]=fVertex[2]=0;
}
+//_______________________________________________________________________
void AliGenerator::VertexInternal()
{
//
}
}
+//_______________________________________________________________________
void AliGenerator::SetTrack(Int_t done, Int_t parent, Int_t pdg,
Float_t *pmom, Float_t *vpos, Float_t *polar,
Float_t tof, AliMCProcess mech, Int_t &ntr,
gAlice->SetTrack(done, parent, pdg, pmom, vpos, polar, tof,
mech, ntr, weight, is);
}
+
+//_______________________________________________________________________
void AliGenerator::SetTrack(Int_t done, Int_t parent, Int_t pdg,
Double_t px, Double_t py, Double_t pz, Double_t e,
Double_t vx, Double_t vy, Double_t vz, Double_t tof,
}
+//_______________________________________________________________________
void AliGenerator:: KeepTrack(Int_t itrack)
{
if (fStack)
}
+//_______________________________________________________________________
void AliGenerator:: SetHighWaterMark(Int_t nt)
{
if (fStack)
virtual void SetAnalog(Int_t flag=1) {fAnalog=flag;}
virtual void SetVertexSmear(VertexSmear_t smear) {fVertexSmear = smear;}
virtual void SetCutVertexZ(Float_t cut=999999.) {fCutVertexZ = cut;}
- virtual void SetVertexSource(VertexSource_t smear) {fVertexSource = kInternal;}
+ virtual void SetVertexSource(VertexSource_t) {fVertexSource = kInternal;}
virtual void SetTrackingFlag(Int_t flag=1) {fTrackIt=flag;}
void Vertex();
void VertexExternal();
/*
$Log$
+Revision 1.10 2001/10/09 18:00:35 hristov
+Temporary fix to provide unique event number in the simulation (J.Chudoba)
+
Revision 1.9 2001/05/23 08:54:53 hristov
Typo corrected
ClassImp(AliHeader)
-AliHeader::AliHeader()
+//_______________________________________________________________________
+AliHeader::AliHeader():
+ fRun(0),
+ fNvertex(0),
+ fNprimary(0),
+ fNtrack(0),
+ fEvent(0),
+ fEventNrInRun(0),
+ fStack(0),
+ fGenHeader(0)
{
//
// Default constructor
//
- fRun=0;
- fNvertex=0;
- fNprimary=0;
- fNtrack=0;
- fEvent=0;
- fStack=0;
- fGenHeader = 0;
- fEventNrInRun=0;
}
-AliHeader::AliHeader(Int_t run, Int_t event)
+//_______________________________________________________________________
+AliHeader::AliHeader(const AliHeader& head):
+ TObject(head),
+ fRun(0),
+ fNvertex(0),
+ fNprimary(0),
+ fNtrack(0),
+ fEvent(0),
+ fEventNrInRun(0),
+ fStack(0),
+ fGenHeader(0)
{
//
- // Standard constructor
+ // Copy constructor
//
- fRun=run;
- fNvertex=0;
- fNprimary=0;
- fNtrack=0;
- fEvent=event;
- fStack=0;
- fGenHeader = 0;
+ head.Copy(*this);
}
-AliHeader::AliHeader(Int_t run, Int_t event, Int_t evNumber)
+//_______________________________________________________________________
+AliHeader::AliHeader(Int_t run, Int_t event):
+ fRun(run),
+ fNvertex(0),
+ fNprimary(0),
+ fNtrack(0),
+ fEvent(event),
+ fEventNrInRun(0),
+ fStack(0),
+ fGenHeader(0)
{
//
// Standard constructor
//
- fRun=run;
- fNvertex=0;
- fNprimary=0;
- fNtrack=0;
- fEvent=event;
- fEventNrInRun=evNumber;
- fStack=0;
- fGenHeader = 0;
}
+//_______________________________________________________________________
+AliHeader::AliHeader(Int_t run, Int_t event, Int_t evNumber):
+ fRun(run),
+ fNvertex(0),
+ fNprimary(0),
+ fNtrack(0),
+ fEvent(event),
+ fEventNrInRun(evNumber),
+ fStack(0),
+ fGenHeader(0)
+{
+ //
+ // Standard constructor
+ //
+}
+//_______________________________________________________________________
void AliHeader::Reset(Int_t run, Int_t event)
{
//
fEvent=event;
}
+//_______________________________________________________________________
void AliHeader::Reset(Int_t run, Int_t event, Int_t evNumber)
{
//
fEventNrInRun=evNumber;
}
-void AliHeader::Print(const char* option)
+//_______________________________________________________________________
+void AliHeader::Print(const char*) const
{
//
// Dumps header content
}
+//_______________________________________________________________________
AliStack* AliHeader::Stack() const
{
// Return pointer to stack
return fStack;
}
+//_______________________________________________________________________
void AliHeader::SetStack(AliStack* stack)
{
// Set pointer to stack
fStack = stack;
}
+//_______________________________________________________________________
void AliHeader::SetGenEventHeader(AliGenEventHeader* header)
{
// Set pointer to header for generated event
fGenHeader = header;
}
+//_______________________________________________________________________
AliGenEventHeader* AliHeader::GenEventHeader() const
{
// Get pointer to header for generated event
return fGenHeader;
}
+//_______________________________________________________________________
+void AliHeader::Copy(AliHeader&) const
+{
+ Fatal("Copy","Not implemented\n");
+}
/* $Id$ */
#include <TObject.h>
+
class AliStack;
class AliGenEventHeader;
class AliHeader : public TObject {
public:
AliHeader();
+ AliHeader(const AliHeader& head);
AliHeader(Int_t run, Int_t event);
AliHeader(Int_t run, Int_t eventSerialNr, Int_t evNrInRun);
virtual ~AliHeader() {}
virtual void SetGenEventHeader(AliGenEventHeader* header);
virtual AliGenEventHeader* GenEventHeader() const;
- virtual void Print(const char *opt=0);
+ virtual void Print(const char *opt=0) const;
+
+ AliHeader& operator=(AliHeader& head)
+ {head.Copy(*this); return *this;}
protected:
+
+ void Copy(AliHeader& head) const;
+
Int_t fRun; //Run number
Int_t fNvertex; //Number of vertices
Int_t fNprimary; //Number of primary tracks
/*
$Log$
+Revision 1.7 2002/01/10 09:32:06 hristov
+New fIshunt=2 option that allows to associate to a hit the particle that first entered in the cell where the hit occurred (Y.Schutz)
+
Revision 1.6 2001/01/26 19:58:48 hristov
Major upgrade of AliRoot code
*/
-#include "AliHit.h"
#include "TParticle.h"
+
+#include "AliHit.h"
#include "AliRun.h"
ClassImp(AliHit)
-AliHit::AliHit()
+//_______________________________________________________________________
+AliHit::AliHit():
+ fTrack(0),
+ fX(0),
+ fY(0),
+ fZ(0)
{
//
// Default constructor
//
- fTrack=0;
}
-AliHit::AliHit(Int_t shunt, Int_t track)
+//_______________________________________________________________________
+AliHit::AliHit(Int_t shunt, Int_t track):
+ fTrack(0),
+ fX(0),
+ fY(0),
+ fZ(0)
{
//
// Standard constructor
gAlice->FlagTrack(fTrack);
}
}
-
-
Double_t AliKalmanTrack::fConvConst;
+//_______________________________________________________________________
+AliKalmanTrack::AliKalmanTrack():
+ fLab(-3141593),
+ fChi2(0),
+ fMass(0.13957),
+ fN(0)
+{
+ if (fConvConst==0)
+ Fatal("AliKalmanTrack()","The magnetic field has not been set !\n");
+}
+
+//_______________________________________________________________________
+AliKalmanTrack::AliKalmanTrack(const AliKalmanTrack &t):
+ TObject(t),
+ fLab(t.fLab),
+ fChi2(t.fChi2),
+ fMass(t.fMass),
+ fN(t.fN)
+{
+ if (fConvConst==0)
+ Fatal("AliKalmanTrack(const AliKalmanTrack&)",
+ "The magnetic field has not been set !\n");
+}
+
class AliKalmanTrack : public TObject {
public:
- AliKalmanTrack() {
- if (fConvConst==0)
- Fatal("AliKalmanTrack()","The magnetic field has not been set !\n");
- fLab=-3141593; fChi2=0; fN=0; fMass=0.13957;
- }
- AliKalmanTrack(const AliKalmanTrack &t) {
- if (fConvConst==0)
- Fatal("AliKalmanTrack(const AliKalmanTrack&)",
- "The magnetic field has not been set !\n");
- fLab=t.fLab; fChi2=t.fChi2; fN=t.fN; fMass=t.fMass;
- }
+ AliKalmanTrack();
+ AliKalmanTrack(const AliKalmanTrack &t);
+
virtual ~AliKalmanTrack(){};
void SetLabel(Int_t lab) {fLab=lab;}
Double_t GetChi2() const {return fChi2;}
Double_t GetMass() const {return fMass;}
Int_t GetNumberOfClusters() const {return fN;}
- virtual Int_t GetClusterIndex(Int_t i) const { //reserved for AliTracker
- printf("AliKalmanTrack::GetClusterIndex(Int_t i) must be overloaded !\n");
+ virtual Int_t GetClusterIndex(Int_t) const { //reserved for AliTracker
+ Warning("GetClusterIndex(Int_t)","Method must be overloaded !\n");
return 0;
}
- virtual Int_t Compare(const TObject *o) const {return 0;}
+ virtual Int_t Compare(const TObject *) const {return 0;}
- virtual void GetExternalParameters(Double_t &xr, Double_t x[5]) const {;}
- virtual void GetExternalCovariance(Double_t cov[15]) const {;}
+ virtual void GetExternalParameters(Double_t &/*xr*/, Double_t /*x*/[5]) const {}
+ virtual void GetExternalCovariance(Double_t /*cov*/[15]) const {}
- virtual Double_t GetPredictedChi2(const AliCluster *cluster) const {return 0.;}
+ virtual Double_t GetPredictedChi2(const AliCluster *) const {return 0.;}
virtual
- Int_t PropagateTo(Double_t xr,Double_t x0,Double_t rho) {return 0;}
- virtual Int_t Update(const AliCluster* c, Double_t chi2, UInt_t i) {return 0;}
+ Int_t PropagateTo(Double_t /*xr*/, Double_t /*x0*/, Double_t /*rho*/) {return 0;}
+ virtual Int_t Update(const AliCluster*, Double_t /*chi2*/, UInt_t) {return 0;}
static void SetConvConst(Double_t cc) {fConvConst=cc;}
Double_t GetConvConst() const {return fConvConst;}
/*
$Log$
+Revision 1.29 2002/10/14 14:57:32 hristov
+Merging the VirtualMC branch to the main development branch (HEAD)
+
Revision 1.28.6.2 2002/07/24 10:08:13 alibrary
Updating VirtualMC
//
//////////////////////////////////////////////////////////////
+#include "TClonesArray.h"
+#include "TH2.h"
#include "TMath.h"
+#include "TString.h"
-#include "AliLego.h"
-
+#include "AliConst.h"
#include "AliDebugVolume.h"
-#include "AliRun.h"
+#include "AliLego.h"
#include "AliLegoGenerator.h"
-#include "AliConst.h"
#include "AliMC.h"
-#include "TH2.h"
-#include "TString.h"
-#include "TClonesArray.h"
+#include "AliRun.h"
ClassImp(AliLego)
-
-//___________________________________________
-AliLego::AliLego()
+//_______________________________________________________________________
+AliLego::AliLego():
+ fGener(0),
+ fTotRadl(0),
+ fTotAbso(0),
+ fTotGcm2(0),
+ fHistRadl(0),
+ fHistAbso(0),
+ fHistGcm2(0),
+ fHistReta(0),
+ fVolumesFwd(0),
+ fVolumesBwd(0),
+ fStepBack(0),
+ fStepsBackward(0),
+ fStepsForward(0),
+ fErrorCondition(0),
+ fDebug(0)
{
//
// Default constructor
//
- fGener = 0;
- fHistRadl = 0;
- fHistAbso = 0;
- fHistGcm2 = 0;
- fHistReta = 0;
- fVolumesFwd = 0;
- fVolumesBwd = 0;
}
-//___________________________________________
+//_______________________________________________________________________
+AliLego::AliLego(const AliLego &lego):
+ TNamed(lego),
+ fGener(0),
+ fTotRadl(0),
+ fTotAbso(0),
+ fTotGcm2(0),
+ fHistRadl(0),
+ fHistAbso(0),
+ fHistGcm2(0),
+ fHistReta(0),
+ fVolumesFwd(0),
+ fVolumesBwd(0),
+ fStepBack(0),
+ fStepsBackward(0),
+ fStepsForward(0),
+ fErrorCondition(0),
+ fDebug(0)
+{
+ //
+ // Copy constructor
+ //
+ lego.Copy(*this);
+}
+
+
+//_______________________________________________________________________
AliLego::AliLego(const char *title, Int_t ntheta, Float_t thetamin,
- Float_t thetamax, Int_t nphi, Float_t phimin, Float_t phimax,
- Float_t rmin, Float_t rmax, Float_t zmax)
- : TNamed("Lego Generator",title)
+ Float_t thetamax, Int_t nphi, Float_t phimin, Float_t phimax,
+ Float_t rmin, Float_t rmax, Float_t zmax):
+ TNamed("Lego Generator",title),
+ fGener(0),
+ fTotRadl(0),
+ fTotAbso(0),
+ fTotGcm2(0),
+ fHistRadl(0),
+ fHistAbso(0),
+ fHistGcm2(0),
+ fHistReta(0),
+ fVolumesFwd(0),
+ fVolumesBwd(0),
+ fStepBack(0),
+ fStepsBackward(0),
+ fStepsForward(0),
+ fErrorCondition(0),
+ fDebug(0)
{
//
// specify the angular limits and the size of the rectangular box
//
fGener = new AliLegoGenerator(ntheta, thetamin, thetamax,
nphi, phimin, phimax, rmin, rmax, zmax);
-
-
-
fHistRadl = new TH2F("hradl","Radiation length map",
ntheta,thetamin,thetamax,nphi,phimin,phimax);
fHistAbso = new TH2F("habso","Interaction length map",
fHistGcm2 = new TH2F("hgcm2","g/cm2 length map",
ntheta,thetamin,thetamax,nphi,phimin,phimax);
//
- fStepBack = 0;
- fStepsBackward = 0;
- fStepsForward = 0;
- fStepBack = 0;
fVolumesFwd = new TClonesArray("AliDebugVolume",1000);
fVolumesBwd = new TClonesArray("AliDebugVolume",1000);
fDebug = gAlice->GetDebug();
- fErrorCondition = 0;
}
-AliLego::AliLego(const char *title, AliLegoGenerator* generator)
- : TNamed("Lego Generator",title)
+//_______________________________________________________________________
+AliLego::AliLego(const char *title, AliLegoGenerator* generator):
+ TNamed("Lego Generator",title),
+ fGener(0),
+ fTotRadl(0),
+ fTotAbso(0),
+ fTotGcm2(0),
+ fHistRadl(0),
+ fHistAbso(0),
+ fHistGcm2(0),
+ fHistReta(0),
+ fVolumesFwd(0),
+ fVolumesBwd(0),
+ fStepBack(0),
+ fStepsBackward(0),
+ fStepsForward(0),
+ fErrorCondition(0),
+ fDebug(0)
{
//
// specify the angular limits and the size of the rectangular box
//
- fGener = generator;
- Float_t c1min, c1max, c2min, c2max;
- Int_t n1 = fGener->NCoor1();
- Int_t n2 = fGener->NCoor2();
-
- fGener->Coor1Range(c1min, c1max);
- fGener->Coor2Range(c2min, c2max);
+ fGener = generator;
+ Float_t c1min, c1max, c2min, c2max;
+ Int_t n1 = fGener->NCoor1();
+ Int_t n2 = fGener->NCoor2();
+
+ fGener->Coor1Range(c1min, c1max);
+ fGener->Coor2Range(c2min, c2max);
+
+ fHistRadl = new TH2F("hradl","Radiation length map",
+ n2, c2min, c2max, n1, c1min, c1max);
+ fHistAbso = new TH2F("habso","Interaction length map",
+ n2, c2min, c2max, n1, c1min, c1max);
+ fHistGcm2 = new TH2F("hgcm2","g/cm2 length map",
+ n2, c2min, c2max, n1, c1min, c1max);
+ //
+ //
- fHistRadl = new TH2F("hradl","Radiation length map",
- n2, c2min, c2max, n1, c1min, c1max);
- fHistAbso = new TH2F("habso","Interaction length map",
- n2, c2min, c2max, n1, c1min, c1max);
- fHistGcm2 = new TH2F("hgcm2","g/cm2 length map",
- n2, c2min, c2max, n1, c1min, c1max);
-//
-//
- fStepBack = 0;
- fStepsBackward = 0;
- fStepsForward = 0;
- fStepBack = 0;
- fVolumesFwd = new TClonesArray("AliDebugVolume",1000);
- fVolumesBwd = new TClonesArray("AliDebugVolume",1000);
- fDebug = gAlice->GetDebug();
- fErrorCondition =0;
+ fVolumesFwd = new TClonesArray("AliDebugVolume",1000);
+ fVolumesBwd = new TClonesArray("AliDebugVolume",1000);
+ fDebug = gAlice->GetDebug();
}
-//___________________________________________
+//_______________________________________________________________________
AliLego::~AliLego()
{
//
delete fHistAbso;
delete fHistGcm2;
delete fGener;
- if (fVolumesFwd) delete fVolumesFwd;
- if (fVolumesBwd) delete fVolumesBwd;
+ delete fVolumesFwd;
+ delete fVolumesBwd;
}
-//___________________________________________
+//_______________________________________________________________________
void AliLego::BeginEvent()
{
//
fTotGcm2 = 0;
if (fDebug) {
- if (fErrorCondition) DumpVolumes();
- fVolumesFwd->Delete();
- fVolumesBwd->Delete();
- fStepsForward = 0;
- fStepsBackward = 0;
- fErrorCondition = 0;
- if (gAlice->CurrentTrack() == 0) fStepBack = 0;
+ if (fErrorCondition) DumpVolumes();
+ fVolumesFwd->Delete();
+ fVolumesBwd->Delete();
+ fStepsForward = 0;
+ fStepsBackward = 0;
+ fErrorCondition = 0;
+ if (gAlice->CurrentTrack() == 0) fStepBack = 0;
}
}
-//___________________________________________
+//_______________________________________________________________________
void AliLego::FinishEvent()
{
//
fHistGcm2->Fill(c2,c1,fTotGcm2);
}
-//___________________________________________
+//_______________________________________________________________________
void AliLego::FinishRun()
{
//
if (fErrorCondition) DumpVolumes();
}
-//___________________________________________
-void AliLego::Copy(AliLego &lego) const
+//_______________________________________________________________________
+void AliLego::Copy(AliLego&) const
{
//
// Copy *this onto lego -- not implemented
Fatal("Copy","Not implemented!\n");
}
-//___________________________________________
-void AliLego::StepManager() {
-// called from AliRun::Stepmanager from gustep.
-// Accumulate the 3 parameters step by step
-
- static Float_t t;
- Float_t a,z,dens,radl,absl;
- Int_t i, id, copy;
- const char* vol;
- static Float_t vect[3], dir[3];
-
- TString tmp1, tmp2;
- copy = 1;
- id = gMC->CurrentVolID(copy);
- vol = gMC->VolName(id);
- Float_t step = gMC->TrackStep();
-
- TLorentzVector pos, mom;
- gMC->TrackPosition(pos);
- gMC->TrackMomentum(mom);
-
- Int_t status = 0;
- if (gMC->IsTrackEntering()) status = 1;
- if (gMC->IsTrackExiting()) status = 2;
-
-
-
-
+//_______________________________________________________________________
+void AliLego::StepManager()
+{
+ //
+ // called from AliRun::Stepmanager from gustep.
+ // Accumulate the 3 parameters step by step
+ //
+ static Float_t t;
+ Float_t a,z,dens,radl,absl;
+ Int_t i, id, copy;
+ const char* vol;
+ static Float_t vect[3], dir[3];
+
+ TString tmp1, tmp2;
+ copy = 1;
+ id = gMC->CurrentVolID(copy);
+ vol = gMC->VolName(id);
+ Float_t step = gMC->TrackStep();
+
+ TLorentzVector pos, mom;
+ gMC->TrackPosition(pos);
+ gMC->TrackMomentum(mom);
+
+ Int_t status = 0;
+ if (gMC->IsTrackEntering()) status = 1;
+ if (gMC->IsTrackExiting()) status = 2;
+
if (! fStepBack) {
-// printf("\n volume %s %d", vol, status);
-//
-// Normal Forward stepping
-//
- if (fDebug) {
-// printf("\n steps fwd %d %s %d %f", fStepsForward, vol, fErrorCondition, step);
-
-//
-// store volume if different from previous
-//
+ // printf("\n volume %s %d", vol, status);
+ //
+ // Normal Forward stepping
+ //
+ if (fDebug) {
+ // printf("\n steps fwd %d %s %d %f", fStepsForward, vol, fErrorCondition, step);
+
+ //
+ // store volume if different from previous
+ //
TClonesArray &lvols = *fVolumesFwd;
if (fStepsForward > 0) {
- AliDebugVolume* tmp = (AliDebugVolume*) (*fVolumesFwd)[fStepsForward-1];
- if (tmp->IsEqual(vol, copy) && gMC->IsTrackEntering()) {
+ AliDebugVolume* tmp = dynamic_cast<AliDebugVolume*>((*fVolumesFwd)[fStepsForward-1]);
+ if (tmp->IsVEqual(vol, copy) && gMC->IsTrackEntering()) {
fStepsForward -= 2;
fVolumesFwd->RemoveAt(fStepsForward);
fVolumesFwd->RemoveAt(fStepsForward+1);
- }
+ }
}
-
+
new(lvols[fStepsForward++])
- AliDebugVolume(vol,copy,step,pos[0], pos[1], pos[2], status);
-
- } // Debug
-//
-// Get current material properties
-
- gMC->CurrentMaterial(a,z,dens,radl,absl);
+ AliDebugVolume(vol,copy,step,pos[0], pos[1], pos[2], status);
- if (z < 1) return;
+ } // Debug
+ //
+ // Get current material properties
+
+ gMC->CurrentMaterial(a,z,dens,radl,absl);
+
+ if (z < 1) return;
+
+ // --- See if we have to stop now
+ if (TMath::Abs(pos[2]) > fGener->ZMax() ||
+ pos[0]*pos[0] +pos[1]*pos[1] > fGener->RadMax()*fGener->RadMax()) {
+ if (!gMC->IsNewTrack()) {
+ // Not the first step, add past contribution
+ fTotAbso += t/absl;
+ fTotRadl += t/radl;
+ fTotGcm2 += t*dens;
+ if (fDebug) {
+ //
+ // generate "mirror" particle flying back
+ //
+ fStepsBackward = fStepsForward;
+
+ Float_t pmom[3], orig[3];
+ Float_t polar[3] = {0.,0.,0.};
+ Int_t ntr;
+ pmom[0] = -dir[0];
+ pmom[1] = -dir[1];
+ pmom[2] = -dir[2];
+ orig[0] = vect[0];
+ orig[1] = vect[1];
+ orig[2] = vect[2];
+
+ gAlice->SetTrack(1, gAlice->CurrentTrack(),
+ 0, pmom, orig, polar, 0., kPNoProcess, ntr);
+ } // debug
+
+ } // not a new track !
-// --- See if we have to stop now
- if (TMath::Abs(pos[2]) > fGener->ZMax() ||
- pos[0]*pos[0] +pos[1]*pos[1] > fGener->RadMax()*fGener->RadMax()) {
- if (!gMC->IsNewTrack()) {
- // Not the first step, add past contribution
- fTotAbso += t/absl;
- fTotRadl += t/radl;
- fTotGcm2 += t*dens;
- if (fDebug) {
-//
-// generate "mirror" particle flying back
-//
- fStepsBackward = fStepsForward;
-
- Float_t pmom[3], orig[3];
- Float_t polar[3] = {0.,0.,0.};
- Int_t ntr;
- pmom[0] = -dir[0];
- pmom[1] = -dir[1];
- pmom[2] = -dir[2];
- orig[0] = vect[0];
- orig[1] = vect[1];
- orig[2] = vect[2];
-
- gAlice->SetTrack(1, gAlice->CurrentTrack(),
- 0, pmom, orig, polar, 0., kPNoProcess, ntr);
- } // debug
-
- } // not a new track !
-
- if (fDebug) fStepBack = 1;
- gMC->StopTrack();
- return;
- } // outside scoring region ?
-
-// --- See how long we have to go
- for(i=0;i<3;++i) {
- vect[i]=pos[i];
- dir[i]=mom[i];
- }
-
- t = fGener->PropagateCylinder(vect,dir,fGener->RadMax(),fGener->ZMax());
-
- if(step) {
-
- fTotAbso += step/absl;
- fTotRadl += step/radl;
- fTotGcm2 += step*dens;
- }
-
-
+ if (fDebug) fStepBack = 1;
+ gMC->StopTrack();
+ return;
+ } // outside scoring region ?
+
+ // --- See how long we have to go
+ for(i=0;i<3;++i) {
+ vect[i]=pos[i];
+ dir[i]=mom[i];
+ }
+
+ t = fGener->PropagateCylinder(vect,dir,fGener->RadMax(),fGener->ZMax());
+
+ if(step) {
+
+ fTotAbso += step/absl;
+ fTotRadl += step/radl;
+ fTotGcm2 += step*dens;
+ }
+
} else {
if (fDebug) {
-//
-// Geometry debugging
-// Fly back and compare volume sequence
-//
- TClonesArray &lvols = *fVolumesBwd;
- if (fStepsBackward < fStepsForward) {
- AliDebugVolume* tmp = (AliDebugVolume*) (*fVolumesBwd)[fStepsBackward];
- if (tmp->IsEqual(vol, copy) && gMC->IsTrackEntering()) {
- fStepsBackward += 2;
- fVolumesBwd->RemoveAt(fStepsBackward-1);
- fVolumesBwd->RemoveAt(fStepsBackward-2);
+ //
+ // Geometry debugging
+ // Fly back and compare volume sequence
+ //
+ TClonesArray &lvols = *fVolumesBwd;
+ if (fStepsBackward < fStepsForward) {
+ AliDebugVolume* tmp = dynamic_cast<AliDebugVolume*>((*fVolumesBwd)[fStepsBackward]);
+ if (tmp->IsVEqual(vol, copy) && gMC->IsTrackEntering()) {
+ fStepsBackward += 2;
+ fVolumesBwd->RemoveAt(fStepsBackward-1);
+ fVolumesBwd->RemoveAt(fStepsBackward-2);
}
- }
-
- fStepsBackward--;
-// printf("\n steps %d %s %d", fStepsBackward, vol, fErrorCondition);
- if (fStepsBackward < 0) {
+ }
+
+ fStepsBackward--;
+ // printf("\n steps %d %s %d", fStepsBackward, vol, fErrorCondition);
+ if (fStepsBackward < 0) {
gMC->StopTrack();
fStepBack = 0;
return;
- }
-
- new(lvols[fStepsBackward]) AliDebugVolume(vol,copy,step,pos[0], pos[1], pos[2], status);
-
- AliDebugVolume* tmp = (AliDebugVolume*) (*fVolumesFwd)[fStepsBackward];
- if (! (tmp->IsEqual(vol, copy)) && (!fErrorCondition))
- {
- printf("\n Problem at (x,y,z): %d %f %f %f, volumes: %s %s step: %f\n",
- fStepsBackward, pos[0], pos[1], pos[2], tmp->GetName(), vol, step);
- fErrorCondition = 1;
- }
+ }
+
+ new(lvols[fStepsBackward]) AliDebugVolume(vol,copy,step,pos[0], pos[1], pos[2], status);
+
+ AliDebugVolume* tmp = dynamic_cast<AliDebugVolume*>((*fVolumesFwd)[fStepsBackward]);
+ if (! (tmp->IsVEqual(vol, copy)) && (!fErrorCondition))
+ {
+ printf("\n Problem at (x,y,z): %d %f %f %f, volumes: %s %s step: %f\n",
+ fStepsBackward, pos[0], pos[1], pos[2], tmp->GetName(), vol, step);
+ fErrorCondition = 1;
+ }
} // Debug
} // bwd/fwd
}
+//_______________________________________________________________________
void AliLego::DumpVolumes()
{
-//
-// Dump volume sequence in case of error
-//
- printf("\n Dumping Volume Sequence:");
- printf("\n ==============================================");
-
- for (Int_t i = fStepsForward-1; i>=0; i--)
+ //
+ // Dump volume sequence in case of error
+ //
+ printf("\n Dumping Volume Sequence:");
+ printf("\n ==============================================");
+
+ for (Int_t i = fStepsForward-1; i>=0; i--)
{
- AliDebugVolume* tmp1 = (AliDebugVolume*) (*fVolumesFwd)[i];
- AliDebugVolume* tmp2 = (AliDebugVolume*) (*fVolumesBwd)[i];
- if (tmp1)
- printf("\n Volume Fwd: %3d: %5s (%3d) step: %12.5e (x,y,z) (%12.5e %12.5e %12.5e) status: %9s \n"
- , i,
- tmp1->GetName(), tmp1->CopyNumber(), tmp1->Step(),
- tmp1->X(), tmp1->Y(), tmp1->Z(), tmp1->Status());
- if (tmp2 && i>= fStepsBackward)
- printf("\n Volume Bwd: %3d: %5s (%3d) step: %12.5e (x,y,z) (%12.5e %12.5e %12.5e) status: %9s \n"
- , i,
- tmp2->GetName(), tmp2->CopyNumber(), tmp2->Step(),
- tmp2->X(), tmp2->Y(), tmp2->Z(), tmp2->Status());
-
- printf("\n ............................................................................\n");
+ AliDebugVolume* tmp1 = dynamic_cast<AliDebugVolume*>((*fVolumesFwd)[i]);
+ AliDebugVolume* tmp2 = dynamic_cast<AliDebugVolume*>((*fVolumesBwd)[i]);
+ if (tmp1)
+ printf("\n Volume Fwd: %3d: %5s (%3d) step: %12.5e (x,y,z) (%12.5e %12.5e %12.5e) status: %9s \n"
+ , i,
+ tmp1->GetName(), tmp1->CopyNumber(), tmp1->Step(),
+ tmp1->X(), tmp1->Y(), tmp1->Z(), tmp1->Status());
+ if (tmp2 && i>= fStepsBackward)
+ printf("\n Volume Bwd: %3d: %5s (%3d) step: %12.5e (x,y,z) (%12.5e %12.5e %12.5e) status: %9s \n"
+ , i,
+ tmp2->GetName(), tmp2->CopyNumber(), tmp2->Step(),
+ tmp2->X(), tmp2->Y(), tmp2->Z(), tmp2->Status());
+
+ printf("\n ............................................................................\n");
}
- printf("\n ==============================================\n");
+ printf("\n ==============================================\n");
}
-
-
-
-
-
-
-
Float_t themax, Int_t nphi, Float_t phimin,
Float_t phimax,Float_t rmin,Float_t rmax,Float_t zmax);
AliLego(const char *title, AliLegoGenerator* generator);
- AliLego(const AliLego &lego) {lego.Copy(*this);}
+ AliLego(const AliLego &lego);
virtual ~AliLego();
- void Copy(AliLego &lego) const;
virtual void StepManager();
virtual void BeginEvent();
virtual void FinishEvent();
virtual void FinishRun();
virtual AliLego &operator=(const AliLego &lego)
{lego.Copy(*this);return(*this);}
- private:
+
+private:
+ void Copy(AliLego &lego) const;
void DumpVolumes();
-
private:
AliLegoGenerator *fGener; //Lego generator
Float_t fTotRadl; //!Total Radiation length
/*
$Log$
+Revision 1.5 2001/05/16 14:57:22 alibrary
+New files for folders and Stack
+
Revision 1.4 2000/11/30 07:12:49 alibrary
Introducing new Rndm and QA classes
ClassImp(AliLegoGenerator)
-//___________________________________________
-
-AliLegoGenerator::AliLegoGenerator()
+//_______________________________________________________________________
+AliLegoGenerator::AliLegoGenerator():
+ fRadMin(0),
+ fRadMax(0),
+ fZMax(0),
+ fNCoor1(0),
+ fNCoor2(0),
+ fCoor1Min(0),
+ fCoor1Max(0),
+ fCoor2Min(0),
+ fCoor2Max(0),
+ fCoor1Bin(-1),
+ fCoor2Bin(-1),
+ fCurCoor1(0),
+ fCurCoor2(0)
{
//
// Default Constructor
//
SetName("Lego");
-
- fCoor1Bin = fCoor2Bin = -1;
- fCurCoor1 = fCurCoor2 = 0;
}
+//_______________________________________________________________________
AliLegoGenerator::AliLegoGenerator(Int_t nc1, Float_t c1min,
- Float_t c1max, Int_t nc2,
- Float_t c2min, Float_t c2max,
- Float_t rmin, Float_t rmax, Float_t zmax) :
- AliGenerator(0), fRadMin(rmin), fRadMax(rmax), fZMax(zmax), fNCoor1(nc1),
- fNCoor2(nc2), fCoor1Bin(nc1), fCoor2Bin(-1), fCurCoor1(0), fCurCoor2(0)
-
+ Float_t c1max, Int_t nc2,
+ Float_t c2min, Float_t c2max,
+ Float_t rmin, Float_t rmax, Float_t zmax):
+ AliGenerator(0),
+ fRadMin(rmin),
+ fRadMax(rmax),
+ fZMax(zmax),
+ fNCoor1(nc1),
+ fNCoor2(nc2),
+ fCoor1Min(0),
+ fCoor1Max(0),
+ fCoor2Min(0),
+ fCoor2Max(0),
+ fCoor1Bin(nc1),
+ fCoor2Bin(-1),
+ fCurCoor1(0),
+ fCurCoor2(0)
{
//
// Standard generator for Lego rays
//
+ SetName("Lego");
SetCoor1Range(nc1, c1min, c1max);
SetCoor2Range(nc2, c2min, c2max);
- SetName("Lego");
}
-//___________________________________________
+//_______________________________________________________________________
void AliLegoGenerator::Generate()
{
-// Create a geantino with kinematics corresponding to the current bins
-// Here: Coor1 = theta
-// Coor2 = phi.
-
+ // Create a geantino with kinematics corresponding to the current bins
+ // Here: Coor1 = theta
+ // Coor2 = phi.
+
//
// Rootinos are 0
const Int_t kMpart = 0;
}
-//___________________________________________
-Float_t AliLegoGenerator::PropagateCylinder(Float_t *x, Float_t *v, Float_t r, Float_t z)
+//_______________________________________________________________________
+Float_t AliLegoGenerator::PropagateCylinder(Float_t *x, Float_t *v, Float_t r,
+ Float_t z)
{
-// Propagate to cylinder from inside
-
+ //
+ // Propagate to cylinder from inside
+ //
Double_t hnorm, sz, t, t1, t2, t3, sr;
Double_t d[3];
const Float_t kSmall = 1e-8;
/*
$Log$
+Revision 1.7 2002/10/14 14:57:32 hristov
+Merging the VirtualMC branch to the main development branch (HEAD)
+
Revision 1.6.6.1 2002/10/12 21:41:00 hristov
Remove the object from the list of browsables
ClassImp(AliMCQA)
-
-//_____________________________________________________________________________
-AliMCQA::AliMCQA() : fQAList(0), fDetDone(0), fQAHist(0), fVolNames(0),
- fModNames(0),fMPaveLabel(0),fVPaveLabel(0)
+//_______________________________________________________________________
+AliMCQA::AliMCQA():
+ fNdets(0),
+ fNvolumes(0),
+ fQAList(0),
+ fOldId(0),
+ fDetDone(0),
+ fQAHist(0),
+ fVolNames(0),
+ fModNames(0),
+ fMPaveLabel(0),
+ fVPaveLabel(0)
{
//
// Default constructor
//
}
-//_____________________________________________________________________________
-AliMCQA::AliMCQA(Int_t ndets) : fMPaveLabel(0),fVPaveLabel(0)
+//_______________________________________________________________________
+AliMCQA::AliMCQA(const AliMCQA &qa):
+ TObject(qa),
+ fNdets(0),
+ fNvolumes(0),
+ fQAList(0),
+ fOldId(0),
+ fDetDone(0),
+ fQAHist(0),
+ fVolNames(0),
+ fModNames(0),
+ fMPaveLabel(0),
+ fVPaveLabel(0)
+{
+ //
+ // Copy constructor
+ //
+ qa.Copy(*this);
+}
+
+//_______________________________________________________________________
+AliMCQA::AliMCQA(Int_t ndets):
+ fNdets(ndets),
+ fNvolumes(gMC->NofVolumes()),
+ fQAList(new TObjArray(ndets)),
+ fOldId(0),
+ fDetDone(new Int_t[ndets]),
+ fQAHist(new TObjArray(2)),
+ fVolNames(new TObjArray(fNvolumes)),
+ fModNames(new TObjArray(fNdets)),
+ fMPaveLabel(0),
+ fVPaveLabel(0)
{
//
// Constructor, creates the list of lists of histograms
TH1F* h;
Int_t i;
- fNdets=ndets;
-
- fQAList = new TObjArray(ndets);
TObjArray &hist = *fQAList;
char title[100];
//
TObjArray &mods = *(gAlice->Modules());
- AliModule *mod;
TList *dir = gDirectory->GetList();
for (i=0; i<ndets; i++) {
hist[i] = list = new TList();
- mod = (AliModule *) mods[i];
+ AliModule *mod = dynamic_cast<AliModule*>(mods[i]);
// Energy Spectrum
sprintf(title,"Spectrum entering: %s ",mod->GetName());
//
gROOT->GetListOfBrowsables()->Add(this,"AliMCQA");
- fDetDone = new Int_t[fNdets];
-
//
// Global QA histograms
//
- fQAHist = new TObjArray(2);
- fNvolumes=gMC->NofVolumes();
fQAHist->Add(new TH1F("hMCVcalls","Monte Carlo calls per volume",
fNvolumes, 0.5, fNvolumes+0.5));
- h = (TH1F*) dir->FindObject("hMCVcalls");
+ h = dynamic_cast<TH1F*>(dir->FindObject("hMCVcalls"));
h->GetListOfFunctions()->Add(new TExec("ex","gAlice->GetMCQA()->AddVolumeName()"));
dir->Remove(dir->FindObject("hMCVcalls"));
//
// Build list of volume names
//
- fVolNames=new TObjArray(fNvolumes);
for(i=0;i<fNvolumes;++i) {
- AliModule *mod = (AliModule*)
- (*gAlice->Modules())[gAlice->DetFromMate(gMC->VolId2Mate(i+1))];
+ AliModule *mod = dynamic_cast<AliModule*>
+ ((*gAlice->Modules())[gAlice->DetFromMate(gMC->VolId2Mate(i+1))]);
(*fVolNames)[i]=new TNamed(gMC->VolName(i+1),mod->GetName());
}
fQAHist->Add(new TH1F("hMCMcalls","Monte Carlo calls per module",
fNdets, -0.5, fNdets-0.5));
- h = (TH1F*) dir->FindObject("hMCMcalls");
+ h = dynamic_cast<TH1F*>(dir->FindObject("hMCMcalls"));
h->GetListOfFunctions()->Add(new TExec("ex","gAlice->GetMCQA()->AddModuleName()"));
dir->Remove(dir->FindObject("hMCMcalls"));
//
// Build list of module names
//
- fModNames=new TObjArray(fNdets);
for(i=0;i<fNdets;++i)
(*fModNames)[i]=
- new TNamed(((AliModule *)(*gAlice->Modules())[i])->GetName(),"");
+ new TNamed((dynamic_cast<AliModule*>((*gAlice->Modules())[i]))->GetName(),"");
}
-//_____________________________________________________________________________
+//_______________________________________________________________________
+void AliMCQA::Copy(AliMCQA &) const
+{
+ Fatal("Copy ctor","Not implemented!\n");
+}
+//_______________________________________________________________________
AliMCQA::~AliMCQA() {
gROOT->GetListOfBrowsables()->Remove(this);
if (fQAList) {
delete fVPaveLabel;
}
-//_____________________________________________________________________________
+//_______________________________________________________________________
void AliMCQA::Browse(TBrowser *b)
{
//
// Global histos first
//
TIter global(fQAHist);
- while((hist = (TH1*)global()))
+ while((hist = dynamic_cast<TH1*>(global())))
b->Add(hist,hist->GetTitle());
//
// Module histograms now
//
TIter next(fQAList);
TList *histos;
- while((histos = (TList*)next())) {
+ while((histos = dynamic_cast<TList*>(next()))) {
TIter next1(histos);
- while((hist = (TH1*)next1()))
+ while((hist = dynamic_cast<TH1*>(next1())))
b->Add(hist,hist->GetTitle());
}
}
-//_____________________________________________________________________________
+//_______________________________________________________________________
void AliMCQA::PreTrack()
{
//
for(Int_t i=0; i<fNdets; i++) fDetDone[i]=0;
}
-//_____________________________________________________________________________
+//_______________________________________________________________________
void AliMCQA::StepManager(Int_t id)
{
//
//
- static TH1F* mcvcalls = (TH1F*) fQAHist->FindObject("hMCVcalls");
+ static TH1F* mcvcalls = dynamic_cast<TH1F*>(fQAHist->FindObject("hMCVcalls"));
mcvcalls->Fill(gMC->CurrentVolID(copy));
- static TH1F* mcmcalls = (TH1F*) fQAHist->FindObject("hMCMcalls");
+ static TH1F* mcmcalls = dynamic_cast<TH1F*>(fQAHist->FindObject("hMCMcalls"));
mcmcalls->Fill(id);
//
Double_t energy = TMath::Max(p[3]-mass,1.e-12);
if(fOldId > -1) {
if(!fDetDone[fOldId] && !gMC->IsNewTrack()) {
- TList *histold = (TList*) (*fQAList)[fOldId];
- hist = (TH1F*) histold->FindObject("hEnOut");
+ TList *histold = dynamic_cast<TList*>((*fQAList)[fOldId]);
+ hist = dynamic_cast<TH1F*>(histold->FindObject("hEnOut"));
hist->Fill(TMath::Log10(energy));
- hist = (TH1F*) histold->FindObject("hZOut");
+ hist = dynamic_cast<TH1F*>(histold->FindObject("hZOut"));
hist->Fill(x[2]);
fDetDone[fOldId]=1;
}
}
if(!fDetDone[id] && !gMC->IsNewTrack()) {
- TList *histnew = (TList*) (*fQAList)[id];
- hist = (TH1F*) histnew->FindObject("hEnIn");
+ TList *histnew = dynamic_cast<TList*>((*fQAList)[id]);
+ hist = dynamic_cast<TH1F*>(histnew->FindObject("hEnIn"));
hist->Fill(TMath::Log10(energy));
- hist = (TH1F*) histnew->FindObject("hZIn");
+ hist = dynamic_cast<TH1F*>(histnew->FindObject("hZIn"));
hist->Fill(x[2]);
}
fOldId=id;
}
}
-//_____________________________________________________________________________
+//_______________________________________________________________________
void AliMCQA::AddModuleName()
{
//
}
}
-//_____________________________________________________________________________
+//_______________________________________________________________________
void AliMCQA::AddVolumeName()
{
//
}
}
-//_____________________________________________________________________________
+//_______________________________________________________________________
void AliMCQA::DrawPaveLabel(TPaveLabel *&pv)
{
//
pv->Draw();
}
-//_____________________________________________________________________________
+//_______________________________________________________________________
Int_t AliMCQA::GetHBin(const char* hname)
{
//
// Get the bin where the cursor is
//
TList *dir = gDirectory->GetList();
- TH1 *h=(TH1*)dir->FindObject(hname);
+ TH1 *h=dynamic_cast<TH1*>(dir->FindObject(hname));
int px = gPad->GetEventX();
return h->GetXaxis()->FindBin(x);
}
-//_____________________________________________________________________________
+//_______________________________________________________________________
void AliMCQA::DrawModuleName()
{
//
Int_t binx = GetHBin("hMCMcalls");
if(0<binx && binx<=fNdets) {
char lab[15];
- strcpy(lab,((TNamed*)(*fModNames)[binx-1])->GetName());
+ strcpy(lab,dynamic_cast<TNamed*>((*fModNames)[binx-1])->GetName());
fMPaveLabel->SetLabel(lab);
gPad->Modified();
}
}
-//_____________________________________________________________________________
+//_______________________________________________________________________
void AliMCQA::DrawVolumeName()
{
//
Int_t binx = GetHBin("hMCVcalls");
if(0<binx && binx<=fNvolumes) {
char lab[20];
- sprintf(lab,"%s: %s",((TNamed*)(*fVolNames)[binx-1])->GetName(),
- ((TNamed*)(*fVolNames)[binx-1])->GetTitle());
+ sprintf(lab,"%s: %s",dynamic_cast<TNamed*>((*fVolNames)[binx-1])->GetName(),
+ dynamic_cast<TNamed*>((*fVolNames)[binx-1])->GetTitle());
fVPaveLabel->SetLabel(lab);
gPad->Modified();
public:
AliMCQA();
AliMCQA(Int_t ndets);
+ AliMCQA(const AliMCQA &);
virtual ~AliMCQA();
Bool_t IsFolder() const {return kTRUE;}
virtual void Browse(TBrowser *b);
void AddModuleName();
void DrawVolumeName();
void AddVolumeName();
-
+ AliMCQA & operator=(const AliMCQA &qa)
+ {qa.Copy(*this); return (*this);}
// QA step manager
virtual void StepManager(Int_t id);
TPaveLabel *fVPaveLabel; //! PaveLabel for the Volumes
private:
- AliMCQA(const AliMCQA &) {}
- AliMCQA & operator=(const AliMCQA &) {return (*this);}
void DrawPaveLabel(TPaveLabel *&pv);
Int_t GetHBin(const char* hname);
+ void Copy(AliMCQA& qa) const;
ClassDef(AliMCQA,1) //Quality Assurance class for the MC
};
#endif
-
/*
$Log$
+Revision 1.9 2001/05/16 14:57:22 alibrary
+New files for folders and Stack
+
Revision 1.8 2000/12/18 10:44:01 morsch
Possibility to set field map by passing pointer to objet of type AliMagF via
SetField().
#include "AliMagF.h"
-#include <stdlib.h>
-#include <stdio.h>
-
-
ClassImp(AliMagF)
-//________________________________________
+//_______________________________________________________________________
+AliMagF::AliMagF():
+ fMap(0),
+ fType(0),
+ fInteg(0),
+ fFactor(0),
+ fMax(0),
+ fDebug(0)
+{
+ //
+ // Default constructor
+ //
+}
+
+//_______________________________________________________________________
AliMagF::AliMagF(const char *name, const char *title, const Int_t integ,
- const Float_t factor, const Float_t fmax)
- : TNamed(name,title)
+ const Float_t factor, const Float_t fmax):
+ TNamed(name,title),
+ fMap(0),
+ fType(0),
+ fInteg(0),
+ fFactor(factor),
+ fMax(fmax),
+ fDebug(0)
{
//
// Standard constructor
//
if(integ<0 || integ > 2) {
- Warning("SetField",
- "Invalid magnetic field flag: %5d; Helix tracking chosen instead\n"
- ,integ);
- fInteg = 2;
+ Warning("SetField",
+ "Invalid magnetic field flag: %5d; Helix tracking chosen instead\n"
+ ,integ);
+ fInteg = 2;
} else {
- fInteg = integ;
+ fInteg = integ;
}
fType = kUndef;
- fFactor = factor;
- fMax = fmax;
//
fDebug = 0;
}
-//________________________________________
+//_______________________________________________________________________
void AliMagF::Field(Float_t*, Float_t *b)
{
//
// Method to return the field in one point -- dummy in this case
//
- printf("Undefined MagF Field called, returning 0\n");
+ Warning("Field","Undefined MagF Field called, returning 0\n");
b[0]=b[1]=b[2]=0;
}
-
-
-
-
-
-
-
-
class AliMagF : public TNamed {
public:
- AliMagF(){}
+ AliMagF();
AliMagF(const char *name, const char *title, const Int_t integ,
const Float_t factor = 1., const Float_t fmax = 10.);
virtual ~AliMagF() {}
//ZDC part -------------------------------------------------------------------
- const Float_t kG1=20.443;
- const Float_t kFDIP=-37.96;
- const Float_t kFCORN2=-9.14;
+static const Float_t kG1=20.443;
+static const Float_t kFDIP=-37.96;
+static const Float_t kFCORN2=-9.14;
//
// ZBEG Beginning of the inner triplet
// D1BEG Beginning of separator dipole 1
// D2BEG Beginning of separator dipole 2
// CORBEG Corrector dipole beginning (because of dimuon arm)
//
- const Float_t kCORBEG2=19216.,kCOREND2=kCORBEG2+170., kCOR2RA2=4.5*4.5;
+static const Float_t kCORBEG2=19216.,kCOREND2=kCORBEG2+170., kCOR2RA2=4.5*4.5;
//
- const Float_t kZBEG=2300.;
- const Float_t kZ1BEG=kZBEG+ 0.,kZ1END=kZ1BEG+630.,kZ1RA2=3.5*3.5;
- const Float_t kZ2BEG=kZBEG+ 880.,kZ2END=kZ2BEG+550.,kZ2RA2=3.5*3.5;
- const Float_t kZ3BEG=kZBEG+1530.,kZ3END=kZ3BEG+550.,kZ3RA2=3.5*3.5;
- const Float_t kZ4BEG=kZBEG+2430.,kZ4END=kZ4BEG+630.,kZ4RA2=3.5*3.5;
- const Float_t kD1BEG=5838.3 ,kD1END=kD1BEG+945.,kD1RA2=4.5*4.5;
- const Float_t kD2BEG=12147.6 ,kD2END=kD2BEG+945.,kD2RA2=4.5*4.5;
+static const Float_t kZBEG=2300.;
+static const Float_t kZ1BEG=kZBEG+ 0.,kZ1END=kZ1BEG+630.,kZ1RA2=3.5*3.5;
+static const Float_t kZ2BEG=kZBEG+ 880.,kZ2END=kZ2BEG+550.,kZ2RA2=3.5*3.5;
+static const Float_t kZ3BEG=kZBEG+1530.,kZ3END=kZ3BEG+550.,kZ3RA2=3.5*3.5;
+static const Float_t kZ4BEG=kZBEG+2430.,kZ4END=kZ4BEG+630.,kZ4RA2=3.5*3.5;
+static const Float_t kD1BEG=5838.3 ,kD1END=kD1BEG+945.,kD1RA2=4.5*4.5;
+static const Float_t kD2BEG=12147.6 ,kD2END=kD2BEG+945.,kD2RA2=4.5*4.5;
//
- const Float_t kXCEN1D2=-9.7 ,kYCEN1D2=0.;
- const Float_t kXCEN2D2=9.7 ,kYCEN2D2=0.;
+static const Float_t kXCEN1D2=-9.7 ,kYCEN1D2=0.;
+static const Float_t kXCEN2D2=9.7 ,kYCEN2D2=0.;
//ZDC part -------------------------------------------------------------------
/*
$Log$
+Revision 1.9 2001/09/04 15:05:13 hristov
+Pointer fB is initialised to 0 in the default constructor
+
Revision 1.8 2001/05/28 14:10:35 morsch
SetSolenoidField method to set the L3 field strength. 2 kG is default.
ClassImp(AliMagFCM)
-//________________________________________
+//_______________________________________________________________________
+AliMagFCM::AliMagFCM():
+ fXbeg(0),
+ fYbeg(0),
+ fZbeg(0),
+ fXdel(0),
+ fYdel(0),
+ fZdel(0),
+ fSolenoid(0),
+ fXdeli(0),
+ fYdeli(0),
+ fZdeli(0),
+ fXn(0),
+ fYn(0),
+ fZn(0),
+ fB(0)
+{
+ //
+ // Standard constructor
+ //
+ fType = kConMesh;
+ fMap = 2;
+ SetSolenoidField();
+}
+
+//_______________________________________________________________________
AliMagFCM::AliMagFCM(const char *name, const char *title, const Int_t integ,
- const Float_t factor, const Float_t fmax)
- : AliMagF(name,title,integ,factor,fmax)
+ const Float_t factor, const Float_t fmax):
+ AliMagF(name,title,integ,factor,fmax),
+ fXbeg(0),
+ fYbeg(0),
+ fZbeg(0),
+ fXdel(0),
+ fYdel(0),
+ fZdel(0),
+ fSolenoid(0),
+ fXdeli(0),
+ fYdeli(0),
+ fZdeli(0),
+ fXn(0),
+ fYn(0),
+ fZn(0),
+ fB(0)
{
//
// Standard constructor
//
- fB=0;
fType = kConMesh;
fMap = 2;
SetSolenoidField();
- if(fDebug>-1) printf("%s: Constant Mesh Field %s created: map= %d, factor= %f, file= %s\n",
+ if(fDebug>-1) Info("ctor",
+ "%s: Constant Mesh Field %s created: map= %d, factor= %f, file= %s\n",
ClassName(),fName.Data(), fMap, factor,fTitle.Data());
-
}
-//________________________________________
-AliMagFCM::AliMagFCM(const AliMagFCM &magf)
+//_______________________________________________________________________
+AliMagFCM::AliMagFCM(const AliMagFCM &magf):
+ AliMagF(magf),
+ fXbeg(0),
+ fYbeg(0),
+ fZbeg(0),
+ fXdel(0),
+ fYdel(0),
+ fZdel(0),
+ fSolenoid(0),
+ fXdeli(0),
+ fYdeli(0),
+ fZdeli(0),
+ fXn(0),
+ fYn(0),
+ fZn(0),
+ fB(0)
{
//
// Copy constructor
magf.Copy(*this);
}
-//________________________________________
+//_______________________________________________________________________
void AliMagFCM::Field(Float_t *x, Float_t *b)
{
//
}
}
-//________________________________________
+//_______________________________________________________________________
void AliMagFCM::ReadField()
{
//
}
}
-//________________________________________
+//_______________________________________________________________________
void AliMagFCM::Copy(AliMagFCM & /* magf */) const
{
//
Fatal("Copy","Not implemented!\n");
}
-//________________________________________
-AliMagFCM & AliMagFCM::operator =(const AliMagFCM &magf)
-{
- magf.Copy(*this);
- return *this;
-}
//Alice Magnetic Field with constan mesh
public:
- AliMagFCM(){fB=0;}
+ AliMagFCM();
AliMagFCM(const char *name, const char *title, const Int_t integ,
const Float_t factor, const Float_t fmax);
AliMagFCM(const AliMagFCM &mag);
virtual Float_t SolenoidField() const {return fSolenoid;}
void Copy(AliMagFCM &magf) const;
- virtual AliMagFCM & operator=(const AliMagFCM &magf);
+ virtual AliMagFCM & operator=(const AliMagFCM &magf)
+ {magf.Copy(*this); return *this;}
Float_t Bx(const Int_t ix, const Int_t iy, const Int_t iz) {
return (*fB)(3*(iz*(fXn*fYn)+iy*fXn+ix));
/*
$Log$
+Revision 1.12 2001/05/28 14:10:35 morsch
+SetSolenoidField method to set the L3 field strength. 2 kG is default.
+
Revision 1.11 2001/02/08 13:18:00 hristov
Print removed (J.Gosset)
#include <stdlib.h>
-#include "AliMagFDM.h"
#include "TSystem.h"
+
+#include "AliMagFDM.h"
ClassImp(AliMagFDM)
-//________________________________________
+//_______________________________________________________________________
+AliMagFDM::AliMagFDM():
+ fSolenoid(0),
+ fInd(0),
+ fZmin(0),
+ fZmax(0),
+ fYmax(0),
+ fYmin(0),
+ fZpmx(0),
+ fZpmn(0),
+ fRmax(0),
+ fRmin(0),
+ fXdel(0),
+ fYdel(0),
+ fZdel(0),
+ fRdel(0),
+ fPhid(0),
+ fZpdl(0),
+ fCx1(0),
+ fCx2(0),
+ fAx1(0),
+ fAx2(0),
+ fXl(0),
+ fYl(0),
+ fZl(0),
+ fRn(0),
+ fPhin(0),
+ fZpl(0)
+{
+ //
+ // Default constructor for the Dipole field
+ //
+}
+
+//_______________________________________________________________________
AliMagFDM::AliMagFDM(const char *name, const char *title, const Int_t integ,
- const Float_t factor, const Float_t fmax)
- : AliMagF(name,title,integ,factor,fmax)
+ const Float_t factor, const Float_t fmax):
+ AliMagF(name,title,integ,factor,fmax),
+ fSolenoid(0),
+ fInd(0),
+ fZmin(0),
+ fZmax(0),
+ fYmax(0),
+ fYmin(0),
+ fZpmx(0),
+ fZpmn(0),
+ fRmax(0),
+ fRmin(0),
+ fXdel(0),
+ fYdel(0),
+ fZdel(0),
+ fRdel(0),
+ fPhid(0),
+ fZpdl(0),
+ fCx1(0),
+ fCx2(0),
+ fAx1(0),
+ fAx2(0),
+ fXl(0),
+ fYl(0),
+ fZl(0),
+ fRn(0),
+ fPhin(0),
+ fZpl(0)
{
//
// Standard constructor for the Dipole field
fMap = 3;
SetSolenoidField();
- printf("Field Map for Muon Arm from IP till muon filter %s created: map= %d, integ= %d, factor= %f, file=%s\n",fName.Data(), fMap ,integ,factor,fTitle.Data());
+ Info("ctor",
+ "Field Map for Muon Arm from IP till muon filter %s created: map= %d, integ= %d, factor= %f, file=%s\n",
+ fName.Data(), fMap ,integ,factor,fTitle.Data());
}
-//________________________________________
-
+//_______________________________________________________________________
void AliMagFDM::Field(Float_t *xfi, Float_t *b)
{
//
// Main routine to compute the field in a point
//
- static const Double_t keps=0.1E-06;
- static const Double_t PI2=2.*TMath::Pi();
- static const Double_t kone=1;
-
- static const Int_t kiip=33;
- static const Int_t kmiip=0;
- static const Int_t kliip=0;
-
- static const Int_t kiic=0;
- static const Int_t kmiic=0;
- static const Int_t kliic=0;
-
- static const Double_t kfZbg=502.92; // Start of Map using in z
- static const Double_t kfZL3=600; // Beginning of L3 door in z
+ const Double_t keps=0.1E-06;
+ const Double_t PI2=2.*TMath::Pi();
+ const Double_t kone=1;
+
+ const Int_t kiip=33;
+ const Int_t kmiip=0;
+ const Int_t kliip=0;
+
+ const Int_t kiic=0;
+ const Int_t kmiic=0;
+ const Int_t kliic=0;
+
+ const Double_t kfZbg=502.92; // Start of Map using in z
+ const Double_t kfZL3=600; // Beginning of L3 door in z
Double_t x[3];
Double_t xL3[3];
Double_t bint[3];
Double_t r0;
- Int_t iKvar,jb;
+ Int_t iKvar,jb;
Double_t zp1, zp2,xp1,xp2,yp1,yp2;
Double_t zz1, zz2,yy1,yy2,x2,x1;
}
}
-//_____________________ FZ ____________________
-
-Int_t AliMagFDM::FZ(Double_t temp, Float_t *Ar, Float_t delu,Int_t ik,Int_t nk)
+//_______________________________________________________________________
+Int_t AliMagFDM::FZ(Double_t temp, Float_t *Ar,
+ Float_t delu, Int_t ik,Int_t nk)
{
//
// Quest of a point position at x,y,z (Cartensian) and R,Phi,z (Polar) axises
return kf;
}
-/*---------------------Ba------------------*/
-
-Double_t AliMagFDM::Ba(Int_t kaai,Double_t zaa1, Double_t zaa2, Double_t alf1, Double_t alf2, Double_t alf3, Int_t kaa, Int_t maa)
+//_______________________________________________________________________
+Double_t AliMagFDM::Ba(Int_t kaai,Double_t zaa1, Double_t zaa2,
+ Double_t alf1, Double_t alf2, Double_t alf3,
+ Int_t kaa, Int_t maa)
{
//
// Calculation of field componet for case (keps <r0<= fRdel) at a given axis
}
-/*------------------------Bb--------------------------*/
-
-Double_t AliMagFDM::Bb(Double_t z1,Double_t z2, Double_t y1,Double_t y2, Double_t x1,Double_t x2, Int_t kv, Int_t k, Int_t l, Int_t m)
+//_______________________________________________________________________
+Double_t AliMagFDM::Bb(Double_t z1,Double_t z2, Double_t y1,Double_t y2,
+ Double_t x1,Double_t x2, Int_t kv, Int_t k, Int_t l, Int_t m)
{
//
// Calculation of field componet at a given axis (general case)
return bbi;
}
-//____________________________________________
+//_______________________________________________________________________
void AliMagFDM::ReadField()
{
//
exit(1);
}
}
-//________________________________
//Alice Magnetic Field:Magnetic field map from IP to muon filter for Muon arm
public:
- AliMagFDM(){}
+ AliMagFDM();
AliMagFDM(const char *name, const char *title, const Int_t integ,
const Float_t factor, const Float_t fmax);
virtual ~AliMagFDM(){}
virtual void Field(Float_t *x, Float_t *b);
virtual void ReadField();
virtual void SetSolenoidField(Float_t field = 2.) {fSolenoid = field;}
- virtual Float_t SolenoidField() {return fSolenoid;}
+ virtual Float_t SolenoidField() const {return fSolenoid;}
Int_t FZ(Double_t u, Float_t *Ar, Float_t du, Int_t ki, Int_t nu);
Double_t Ba(Int_t kai, Double_t za1, Double_t za2, Double_t al1, Double_t al2, Double_t al3, Int_t ka, Int_t ma);
Double_t Bb(Double_t z1, Double_t z2, Double_t y1, Double_t y2, Double_t x1, Double_t x2, Int_t kvr, Int_t k, Int_t l, Int_t m);
/*
$Log$
+Revision 1.8 2002/10/14 14:57:32 hristov
+Merging the VirtualMC branch to the main development branch (HEAD)
+
Revision 1.5.6.2 2002/08/01 15:35:30 alibrary
Updating VirtualMC
#include <TFile.h>
#include <TSystem.h>
+
#include "AliFieldMap.h"
#include "AliMagFMaps.h"
ClassImp(AliMagFMaps)
-//________________________________________
+//_______________________________________________________________________
+AliMagFMaps::AliMagFMaps():
+ fSolenoid(0),
+ fL3Option(0),
+ fFieldRead(0)
+{
+ //
+ // Default constructor
+ //
+ fFieldMap[0] = fFieldMap[1] = fFieldMap[2] = 0;
+}
+
+//_______________________________________________________________________
AliMagFMaps::AliMagFMaps(const char *name, const char *title, const Int_t integ,
- const Float_t factor, const Float_t fmax, const Int_t map,
- const Int_t l3)
- : AliMagF(name,title,integ,factor,fmax)
+ const Float_t factor, const Float_t fmax, const Int_t map,
+ const Int_t l3):
+ AliMagF(name,title,integ,factor,fmax),
+ fSolenoid(0),
+ fL3Option(l3),
+ fFieldRead(0)
{
//
// Standard constructor
ReadField();
fFieldRead = 1;
-//
-// Don't replicate field information in gAlice
+ //
+ // Don't replicate field information in gAlice
for (Int_t i = 0; i < 3; i++) fFieldMap[i]->SetWriteEnable(0);
-//
-
+ //
}
-//________________________________________
-AliMagFMaps::AliMagFMaps(const AliMagFMaps &magf)
+//_______________________________________________________________________
+AliMagFMaps::AliMagFMaps(const AliMagFMaps &magf):
+ AliMagF(magf),
+ fSolenoid(0),
+ fL3Option(0),
+ fFieldRead(0)
{
//
// Copy constructor
magf.Copy(*this);
}
+//_______________________________________________________________________
AliMagFMaps::~AliMagFMaps()
{
-//
-// Destructor
-//
- delete fFieldMap[0];
- delete fFieldMap[1];
- delete fFieldMap[2];
+ //
+ // Destructor
+ //
+ delete fFieldMap[0];
+ delete fFieldMap[1];
+ delete fFieldMap[2];
}
+//_______________________________________________________________________
void AliMagFMaps::ReadField()
{
-// Read Field Map from file
-//
-// don't read twice
-//
- if (fFieldRead) return;
- fFieldRead = 1;
-//
- char* fname;
- TFile* file = 0;
- if (fMap == k2kG) {
+ // Read Field Map from file
+ //
+ // don't read twice
+ //
+ if (fFieldRead) return;
+ fFieldRead = 1;
+ //
+ char* fname;
+ TFile* file = 0;
+ if (fMap == k2kG) {
if (fL3Option) {
- fname = gSystem->ExpandPathName("$(ALICE_ROOT)/data/maps/L3B02.root");
- file = new TFile(fname);
- fFieldMap[0] = (AliFieldMap*) file->Get("L3B02");
- file->Close();
- delete file;
+ fname = gSystem->ExpandPathName("$(ALICE_ROOT)/data/maps/L3B02.root");
+ file = new TFile(fname);
+ fFieldMap[0] = dynamic_cast<AliFieldMap*>(file->Get("L3B02"));
+ file->Close();
+ delete file;
}
fname = gSystem->ExpandPathName("$(ALICE_ROOT)/data/maps/DipB02.root");
file = new TFile(fname);
- fFieldMap[1] = (AliFieldMap*) file->Get("DipB02");
+ fFieldMap[1] = dynamic_cast<AliFieldMap*>(file->Get("DipB02"));
file->Close();
delete file;;
fname = gSystem->ExpandPathName("$(ALICE_ROOT)/data/maps/ExtB02.root");
file = new TFile(fname);
- fFieldMap[2] = (AliFieldMap*) file->Get("ExtB02");
+ fFieldMap[2] = dynamic_cast<AliFieldMap*>(file->Get("ExtB02"));
file->Close();
delete file;
fSolenoid = 2.;
- } else if (fMap == k4kG) {
+ } else if (fMap == k4kG) {
if (fL3Option) {
- fname = gSystem->ExpandPathName("$(ALICE_ROOT)/data/maps/L3B04.root");
- file = new TFile(fname);
- fFieldMap[0] = (AliFieldMap*) file->Get("L3B04");
- file->Close();
- delete file;
+ fname = gSystem->ExpandPathName("$(ALICE_ROOT)/data/maps/L3B04.root");
+ file = new TFile(fname);
+ fFieldMap[0] = dynamic_cast<AliFieldMap*>(file->Get("L3B04"));
+ file->Close();
+ delete file;
}
fname = gSystem->ExpandPathName("$(ALICE_ROOT)/data/maps/DipB04.root");
file = new TFile(fname);
- fFieldMap[1] = (AliFieldMap*) file->Get("DipB04");
+ fFieldMap[1] = dynamic_cast<AliFieldMap*>(file->Get("DipB04"));
file->Close();
- delete file;;
+ delete file;
fname = gSystem->ExpandPathName("$(ALICE_ROOT)/data/maps/ExtB04.root");
file = new TFile(fname);
- fFieldMap[2] = (AliFieldMap*) file->Get("ExtB04");
+ fFieldMap[2] = dynamic_cast<AliFieldMap*>(file->Get("ExtB04"));
file->Close();
delete file;
fSolenoid = 4.;
- } else if (fMap == k5kG) {
+ } else if (fMap == k5kG) {
if (fL3Option) {
- fname = gSystem->ExpandPathName("$(ALICE_ROOT)/data/maps/L3B05.root");
- file = new TFile(fname);
- fFieldMap[0] = (AliFieldMap*) file->Get("L3B05");
- file->Close();
- delete file;
+ fname = gSystem->ExpandPathName("$(ALICE_ROOT)/data/maps/L3B05.root");
+ file = new TFile(fname);
+ fFieldMap[0] = dynamic_cast<AliFieldMap*>(file->Get("L3B05"));
+ file->Close();
+ delete file;
}
fname = gSystem->ExpandPathName("$(ALICE_ROOT)/data/maps/DipB05.root");
file = new TFile(fname);
- fFieldMap[1] = (AliFieldMap*) file->Get("DipB05");
+ fFieldMap[1] = dynamic_cast<AliFieldMap*>(file->Get("DipB05"));
file->Close();
- delete file;;
+ delete file;
fname = gSystem->ExpandPathName("$(ALICE_ROOT)/data/maps/ExtB05.root");
file = new TFile(fname);
- fFieldMap[2] = (AliFieldMap*) file->Get("ExtB05");
+ fFieldMap[2] = dynamic_cast<AliFieldMap*>(file->Get("ExtB05"));
file->Close();
delete file;
fSolenoid = 5.;
- }
-
- if (!fL3Option) {
-//
-// Dummy L3 map
+ }
+
+ if (!fL3Option) {
+ //
+ // Dummy L3 map
fFieldMap[0] = new AliFieldMap();
fFieldMap[0] -> SetLimits(-800., 800., -800., 800., -700., 700.);
- }
+ }
}
-
+//_______________________________________________________________________
Float_t AliMagFMaps::SolenoidField() const
{
-//
-// Returns max. L3 (solenoid) field strength
-// according to field map setting
-
- return fSolenoid;
+ //
+ // Returns max. L3 (solenoid) field strength
+ // according to field map setting
+ //
+ return fSolenoid;
}
-
-
-//________________________________________
+//_______________________________________________________________________
void AliMagFMaps::Field(Float_t *x, Float_t *b)
{
//
// --- find the position in the grid ---
if (!fFieldRead) ReadField();
-
+
b[0]=b[1]=b[2]=0;
AliFieldMap* map = 0;
if (fFieldMap[0]->Inside(x[0], x[1], x[2])) {
- map = fFieldMap[0];
- if (!fL3Option) {
-//
-// Constant L3 field, if this option was selected
-//
+ map = fFieldMap[0];
+ if (!fL3Option) {
+ //
+ // Constant L3 field, if this option was selected
+ //
b[2] = fSolenoid;
return;
- }
+ }
} else if (fFieldMap[1]->Inside(x[0], x[1], x[2])) {
- map = fFieldMap[1];
+ map = fFieldMap[1];
} else if (fFieldMap[2]->Inside(x[0], x[1], x[2])) {
- map = fFieldMap[2];
+ map = fFieldMap[2];
}
if(map){
- map->Field(x,b);
+ map->Field(x,b);
} else {
-//This is the ZDC part
- Float_t rad2=x[0]*x[0]+x[1]*x[1];
- if(x[2]>kCORBEG2 && x[2]<kCOREND2){
+ //This is the ZDC part
+ Float_t rad2=x[0]*x[0]+x[1]*x[1];
+ if(x[2]>kCORBEG2 && x[2]<kCOREND2){
if(rad2<kCOR2RA2){
- b[0] = kFCORN2;
+ b[0] = kFCORN2;
}
- }
- else if(x[2]>kZ1BEG && x[2]<kZ1END){
+ }
+ else if(x[2]>kZ1BEG && x[2]<kZ1END){
if(rad2<kZ1RA2){
- b[0] = -kG1*x[1];
- b[1] = -kG1*x[0];
+ b[0] = -kG1*x[1];
+ b[1] = -kG1*x[0];
}
- }
- else if(x[2]>kZ2BEG && x[2]<kZ2END){
+ }
+ else if(x[2]>kZ2BEG && x[2]<kZ2END){
if(rad2<kZ2RA2){
- b[0] = kG1*x[1];
- b[1] = kG1*x[0];
+ b[0] = kG1*x[1];
+ b[1] = kG1*x[0];
}
- }
- else if(x[2]>kZ3BEG && x[2]<kZ3END){
+ }
+ else if(x[2]>kZ3BEG && x[2]<kZ3END){
if(rad2<kZ3RA2){
- b[0] = kG1*x[1];
- b[1] = kG1*x[0];
+ b[0] = kG1*x[1];
+ b[1] = kG1*x[0];
}
- }
- else if(x[2]>kZ4BEG && x[2]<kZ4END){
+ }
+ else if(x[2]>kZ4BEG && x[2]<kZ4END){
if(rad2<kZ4RA2){
- b[0] = -kG1*x[1];
- b[1] = -kG1*x[0];
+ b[0] = -kG1*x[1];
+ b[1] = -kG1*x[0];
}
- }
- else if(x[2]>kD1BEG && x[2]<kD1END){
+ }
+ else if(x[2]>kD1BEG && x[2]<kD1END){
if(rad2<kD1RA2){
- b[1] = -kFDIP;
+ b[1] = -kFDIP;
}
- }
- else if(x[2]>kD2BEG && x[2]<kD2END){
+ }
+ else if(x[2]>kD2BEG && x[2]<kD2END){
if(((x[0]-kXCEN1D2)*(x[0]-kXCEN1D2)+(x[1]-kYCEN1D2)*(x[1]-kYCEN1D2))<kD2RA2
|| ((x[0]-kXCEN2D2)*(x[0]-kXCEN2D2)+(x[1]-kYCEN2D2)*(x[1]-kYCEN2D2))<kD2RA2){
- b[1] = kFDIP;
+ b[1] = kFDIP;
}
- }
+ }
}
if(fFactor!=1) {
- b[0]*=fFactor;
- b[1]*=fFactor;
- b[2]*=fFactor;
+ b[0]*=fFactor;
+ b[1]*=fFactor;
+ b[2]*=fFactor;
}
}
-//________________________________________
+//_______________________________________________________________________
void AliMagFMaps::Copy(AliMagFMaps & /* magf */) const
{
//
Fatal("Copy","Not implemented!\n");
}
-//________________________________________
-AliMagFMaps & AliMagFMaps::operator =(const AliMagFMaps &magf)
-{
- magf.Copy(*this);
- return *this;
-}
-
+//_______________________________________________________________________
void AliMagFMaps::Streamer(TBuffer &R__b)
{
- // Stream an object of class AliMagFMaps.
- if (R__b.IsReading()) {
- AliMagFMaps::Class()->ReadBuffer(R__b, this);
- fFieldRead = 0;
- } else {
- AliMagFMaps::Class()->WriteBuffer(R__b, this);
- }
+ // Stream an object of class AliMagFMaps.
+ if (R__b.IsReading()) {
+ AliMagFMaps::Class()->ReadBuffer(R__b, this);
+ fFieldRead = 0;
+ } else {
+ AliMagFMaps::Class()->WriteBuffer(R__b, this);
+ }
}
public:
enum constants {k2kG, k4kG, k5kG};
- AliMagFMaps(){fFieldMap[0] = fFieldMap[1] = fFieldMap[2] = 0; fFieldRead = 0;}
+ AliMagFMaps();
AliMagFMaps(const char *name, const char *title, const Int_t integ,
const Float_t factor, const Float_t fmax, const Int_t map = k2kG,
const Int_t l3 = 1);
virtual Float_t SolenoidField() const;
virtual void SetL3ConstField(Int_t flag = 0) {fL3Option = flag;}
- void Copy(AliMagFMaps &magf) const;
- virtual AliMagFMaps & operator=(const AliMagFMaps &magf);
+ virtual AliMagFMaps & operator=(const AliMagFMaps &magf)
+ {magf.Copy(*this); return *this;}
+
protected:
+ void Copy(AliMagFMaps &magf) const;
+
AliFieldMap* fFieldMap[3]; // Field maps
Float_t fSolenoid; // Solenoid field setting
Int_t fL3Option; // Option for field inside L3
/*
$Log$
+Revision 1.2 2001/10/04 15:50:23 jchudoba
+Implement non default combination
+
Revision 1.1 2001/09/19 06:22:13 jchudoba
Class to generate combinations for merging
ClassImp(AliMergeCombi)
-AliMergeCombi::AliMergeCombi()
+//_______________________________________________________________________
+AliMergeCombi::AliMergeCombi():
+ fDim(1),
+ fSperb(1),
+ fCounter(0)
{
-// default ctor
- fDim = 1;
- fSperb = 1;
- fCounter = 0;
+ //
+ // default ctor
+ //
}
-////////////////////////////////////////////////////////////////////////
-AliMergeCombi::AliMergeCombi(Int_t dim, Int_t sperb)
+//_______________________________________________________________________
+AliMergeCombi::AliMergeCombi(Int_t dim, Int_t sperb):
+ fDim(dim),
+ fSperb(sperb),
+ fCounter(0)
{
-// default ctor
- fDim = dim;
- fSperb = sperb;
- fCounter = 0;
+ //
+ // Standard ctor
+ //
}
-////////////////////////////////////////////////////////////////////////
+//_______________________________________________________________________
AliMergeCombi::~AliMergeCombi()
{
-// default dtor
- ;
+ // default dtor
}
-////////////////////////////////////////////////////////////////////////
-Bool_t AliMergeCombi::Combination(Int_t evNumber[], Int_t delta[])
+//_______________________________________________________________________
+Bool_t AliMergeCombi::Combination(Int_t /* evNumber */ [], Int_t delta[])
{
delta[0] = 1;
for (Int_t i=1; i<fDim; i++) {
}
return kTRUE;
}
-
-////////////////////////////////////////////////////////////////////////
/*
$Log$
+Revision 1.18 2001/12/19 14:46:26 morsch
+Add possibility to disable StepManager() for each module separately.
+
Revision 1.17 2001/08/29 14:28:33 morsch
Use visibility flags -1 and 3 instead of 0 and 1.
ClassImp(AliModule)
-//_____________________________________________________________________________
-AliModule::AliModule()
+//_______________________________________________________________________
+AliModule::AliModule():
+ fEuclidMaterial(""),
+ fEuclidGeometry(""),
+ fIdtmed(0),
+ fIdmate(0),
+ fLoMedium(0),
+ fHiMedium(0),
+ fActive(0),
+ fHistograms(0),
+ fNodes(0),
+ fDebug(0),
+ fEnable(1)
{
//
// Default constructor for the AliModule class
//
- fHistograms = 0;
- fNodes = 0;
- fIdtmed = 0;
- fIdmate = 0;
- fDebug = 0;
- fEnable = 1;
}
-//_____________________________________________________________________________
-AliModule::AliModule(const char* name,const char *title):TNamed(name,title)
+//_______________________________________________________________________
+AliModule::AliModule(const char* name,const char *title):
+ TNamed(name,title),
+ fEuclidMaterial(""),
+ fEuclidGeometry(""),
+ fIdtmed(new TArrayI(100)),
+ fIdmate(new TArrayI(100)),
+ fLoMedium(65536),
+ fHiMedium(0),
+ fActive(0),
+ fHistograms(new TList()),
+ fNodes(new TList()),
+ fDebug(0),
+ fEnable(1)
{
//
// Normal constructor invoked by all Modules.
// Create the list for Module specific histograms
// Add this Module to the global list of Modules in Run.
//
- //
- // Initialises the histogram list
- fHistograms = new TList();
- //
- // Initialises the list of ROOT TNodes
- fNodes = new TList();
- //
// Get the Module numeric ID
Int_t id = gAlice->GetModuleID(name);
if (id>=0) {
//
SetMarkerColor(3);
//
- // Allocate space for tracking media and material indexes
- fIdtmed = new TArrayI(100);
- fIdmate = new TArrayI(100);
+ // Clear space for tracking media and material indexes
+
for(Int_t i=0;i<100;i++) (*fIdmate)[i]=(*fIdtmed)[i]=0;
- //
- // Prepare to find the tracking media range
- fLoMedium = 65536;
- fHiMedium = 0;
AliConfig::Instance()->Add(this);
SetDebug(gAlice->GetDebug());
-
- fEnable = 1;
}
-//_____________________________________________________________________________
-AliModule::AliModule(const AliModule &mod)
+//_______________________________________________________________________
+AliModule::AliModule(const AliModule &mod):
+ TNamed(mod),
+ TAttLine(mod),
+ TAttMarker(mod),
+ AliRndm(mod),
+ fEuclidMaterial(""),
+ fEuclidGeometry(""),
+ fIdtmed(0),
+ fIdmate(0),
+ fLoMedium(0),
+ fHiMedium(0),
+ fActive(0),
+ fHistograms(0),
+ fNodes(0),
+ fDebug(0),
+ fEnable(0)
{
//
// Copy constructor
mod.Copy(*this);
}
-//_____________________________________________________________________________
+//_______________________________________________________________________
AliModule::~AliModule()
{
//
// Destructor
//
- fHistograms = 0;
- //
+
// Delete ROOT geometry
if(fNodes) {
fNodes->Clear();
delete fIdmate;
}
-//_____________________________________________________________________________
+//_______________________________________________________________________
void AliModule::Copy(AliModule & /* mod */) const
{
//
Fatal("Copy","Not implemented!\n");
}
-//_____________________________________________________________________________
+//_______________________________________________________________________
void AliModule::Disable()
{
//
//
// Loop through geometry to disable all
// nodes for this Module
- while((node = (TNode*)next())) {
+ while((node = dynamic_cast<TNode*>(next()))) {
node->SetVisibility(-1);
}
}
-//_____________________________________________________________________________
+//_______________________________________________________________________
Int_t AliModule::DistancetoPrimitive(Int_t, Int_t)
{
//
return 9999;
}
-//_____________________________________________________________________________
+//_______________________________________________________________________
void AliModule::Enable()
{
//
//
// Loop through geometry to enable all
// nodes for this Module
- while((node = (TNode*)next())) {
+ while((node = dynamic_cast<TNode*>(next()))) {
node->SetVisibility(3);
}
}
-//_____________________________________________________________________________
+//_______________________________________________________________________
void AliModule::AliMaterial(Int_t imat, const char* name, Float_t a,
- Float_t z, Float_t dens, Float_t radl,
- Float_t absl, Float_t *buf, Int_t nwbuf) const
+ Float_t z, Float_t dens, Float_t radl,
+ Float_t absl, Float_t *buf, Int_t nwbuf) const
{
//
// Store the parameters for a material
(*fIdmate)[imat]=kmat;
}
-//_____________________________________________________________________________
+//_______________________________________________________________________
void AliModule::AliGetMaterial(Int_t imat, char* name, Float_t &a,
- Float_t &z, Float_t &dens, Float_t &radl,
- Float_t &absl)
+ Float_t &z, Float_t &dens, Float_t &radl,
+ Float_t &absl)
{
//
// Store the parameters for a material
}
-//_____________________________________________________________________________
+//_______________________________________________________________________
void AliModule::AliMixture(Int_t imat, const char *name, Float_t *a,
- Float_t *z, Float_t dens, Int_t nlmat,
- Float_t *wmat) const
+ Float_t *z, Float_t dens, Int_t nlmat,
+ Float_t *wmat) const
{
//
// Defines mixture or compound imat as composed by
(*fIdmate)[imat]=kmat;
}
-//_____________________________________________________________________________
+//_______________________________________________________________________
void AliModule::AliMedium(Int_t numed, const char *name, Int_t nmat,
- Int_t isvol, Int_t ifield, Float_t fieldm,
- Float_t tmaxfd, Float_t stemax, Float_t deemax,
- Float_t epsil, Float_t stmin, Float_t *ubuf,
- Int_t nbuf) const
+ Int_t isvol, Int_t ifield, Float_t fieldm,
+ Float_t tmaxfd, Float_t stemax, Float_t deemax,
+ Float_t epsil, Float_t stmin, Float_t *ubuf,
+ Int_t nbuf) const
{
//
// Store the parameters of a tracking medium
(*fIdtmed)[numed]=kmed;
}
-//_____________________________________________________________________________
+//_______________________________________________________________________
void AliModule::AliMatrix(Int_t &nmat, Float_t theta1, Float_t phi1,
- Float_t theta2, Float_t phi2, Float_t theta3,
- Float_t phi3) const
+ Float_t theta2, Float_t phi2, Float_t theta3,
+ Float_t phi3) const
{
//
// Define a rotation matrix. Angles are in degrees.
gMC->Matrix(nmat, theta1, phi1, theta2, phi2, theta3, phi3);
}
-//_____________________________________________________________________________
-AliModule& AliModule::operator=(const AliModule &mod)
-{
- mod.Copy(*this);
- return (*this);
-}
-
-//_____________________________________________________________________________
+//_______________________________________________________________________
Float_t AliModule::ZMin() const
{
return -500;
}
-//_____________________________________________________________________________
+//_______________________________________________________________________
Float_t AliModule::ZMax() const
{
return 500;
}
-//_____________________________________________________________________________
+//_______________________________________________________________________
void AliModule::SetEuclidFile(char* material, char* geometry)
{
//
}
}
-//_____________________________________________________________________________
+//_______________________________________________________________________
void AliModule::ReadEuclid(const char* filnam, char* topvol)
{
//
Error("ReadEuclid","reading error or premature end of file\n");
}
-//_____________________________________________________________________________
+//_______________________________________________________________________
void AliModule::ReadEuclidMedia(const char* filnam)
{
//
/* $Id$ */
-#include "TNamed.h"
+#include "Riostream.h"
+
#include "TAttLine.h"
#include "TAttMarker.h"
+#include "TNamed.h"
+
#include "AliRndm.h"
-//#include <TSystem.h>
class TClonesArray;
class TBrowser;
class TArrayI;
virtual void FinishEvent() {}
virtual void FinishRun() {}
virtual void FinishPrimary() {}
- virtual void RemapTrackHitIDs(Int_t *map) {}
- virtual void RemapTrackReferencesIDs(Int_t *map) {} //remaping track references MI
+ virtual void RemapTrackHitIDs(Int_t *) {}
+ virtual void RemapTrackReferencesIDs(Int_t *) {} //remaping track references MI
//virtual void Hits2Digits() {}
virtual void Init() {}
virtual void LoadPoints(Int_t ) {}
- virtual void MakeBranch(Option_t *, const char *file=0 ) {}
- virtual void MakeBranchTR(Option_t *opt=" ", const char *file=0 ){}
+ virtual void MakeBranch(Option_t *, const char* =0 ) {}
+ virtual void MakeBranchTR(Option_t * =" ", const char * =0 ){}
virtual void Paint(Option_t *) {}
virtual void ResetDigits() {}
virtual void ResetSDigits() {}
virtual void SetEuclidFile(char *material,char *geometry=0);
virtual void ReadEuclid(const char *filnam, char *topvol);
virtual void ReadEuclidMedia(const char *filnam);
- AliModule& operator=(const AliModule &mod);
- void Copy(AliModule &mod) const;
+ AliModule& operator=(const AliModule &mod)
+ {mod.Copy(*this); return (*this);}
protected:
+ void Copy(AliModule &mod) const;
+
// Data members
TString fEuclidMaterial; //!Name of the Euclid file for materials (if any)
/*
$Log$
+Revision 1.7 2001/01/26 19:58:48 hristov
+Major upgrade of AliRoot code
+
Revision 1.6 2000/10/02 21:28:14 fca
Removal of useless dependecies via forward declarations
// //
///////////////////////////////////////////////////////////////////////////////
-#include "AliPoints.h"
-#include "AliRun.h"
-#include "AliDetector.h"
#include "TPad.h"
-#include "TView.h"
#include "TParticle.h"
+#include "TView.h"
+
+#include "AliDetector.h"
+#include "AliPoints.h"
+#include "AliRun.h"
ClassImp(AliPoints)
-//_____________________________________________________________________________
-AliPoints::AliPoints()
+//_______________________________________________________________________
+AliPoints::AliPoints():
+ fDetector(0),
+ fIndex(0)
{
//
// Default constructor
//
- fDetector = 0;
- fIndex = 0;
}
-//_____________________________________________________________________________
-AliPoints::AliPoints(const AliPoints &pts)
+//_______________________________________________________________________
+AliPoints::AliPoints(const AliPoints &pts):
+ TPolyMarker3D(pts),
+ fDetector(0),
+ fIndex(0)
{
//
// Copy constructor
pts.Copy(*this);
}
-//_____________________________________________________________________________
-AliPoints::AliPoints(Int_t nhits)
- :TPolyMarker3D(nhits)
+//_______________________________________________________________________
+AliPoints::AliPoints(Int_t nhits):
+ TPolyMarker3D(nhits),
+ fDetector(0),
+ fIndex(0)
{
//
// Standard constructor
//
- fDetector = 0;
- fIndex = 0;
ResetBit(kCanDelete);
}
-//_____________________________________________________________________________
+//_______________________________________________________________________
AliPoints::~AliPoints()
{
//
- // Default constructor
+ // Default destructor
//
- fDetector = 0;
- fIndex = 0;
}
-//_____________________________________________________________________________
+//_______________________________________________________________________
void AliPoints::Copy(AliPoints &pts) const
{
//
// Copy *this onto pts
//
if(this != &pts) {
- ((TPolyMarker3D*)this)->Copy((TPolyMarker3D&)pts);
+ ((TPolyMarker3D*)this)->Copy(dynamic_cast<TPolyMarker3D&>(pts));
pts.fGLList = fGLList;
pts.fLastPoint = fLastPoint;
pts.fDetector = fDetector;
}
}
-
-//_____________________________________________________________________________
+//_______________________________________________________________________
Int_t AliPoints::DistancetoPrimitive(Int_t px, Int_t py)
{
//
return TPolyMarker3D::DistancetoPrimitive(px,py);
}
-//_____________________________________________________________________________
+//_______________________________________________________________________
void AliPoints::DumpParticle()
{
//
if (particle) particle->Dump();
}
-//_____________________________________________________________________________
+//_______________________________________________________________________
void AliPoints::ExecuteEvent(Int_t event, Int_t px, Int_t py)
{
//
}
-//_____________________________________________________________________________
+//_______________________________________________________________________
const Text_t *AliPoints::GetName() const
{
//
return particle->GetName();
}
-//_____________________________________________________________________________
-Text_t *AliPoints::GetObjectInfo(Int_t, Int_t)
+//_______________________________________________________________________
+Text_t *AliPoints::GetObjectInfo(Int_t, Int_t) const
{
//
// Redefines TObject::GetObjectInfo.
return info;
}
-//_____________________________________________________________________________
+//_______________________________________________________________________
TParticle *AliPoints::GetParticle() const
{
//
else return gAlice->Particle(fIndex);
}
-//_____________________________________________________________________________
+//_______________________________________________________________________
void AliPoints::InspectParticle()
{
//
if (particle) particle->Inspect();
}
-//_____________________________________________________________________________
-AliPoints & AliPoints::operator=(const AliPoints &pts)
-{
- //
- // Assignment operator
- //
- pts.Copy(*this);
- return (*this);
-}
-
-//_____________________________________________________________________________
+//_______________________________________________________________________
void AliPoints::Propagate()
{
//
//
TIter next(gAlice->Detectors());
AliDetector *detector;
- while((detector = (AliDetector*)next())) {
+ while((detector = dynamic_cast<AliDetector*>(next()))) {
if (!detector->IsActive()) continue;
points = detector->Points();
if (!points) continue;
ntracks = points->GetEntriesFast();
for (track=0;track<ntracks;track++) {
- pm = (AliPoints*)points->UncheckedAt(track);
+ pm = dynamic_cast<AliPoints*>(points->UncheckedAt(track));
if (!pm) continue;
if (fIndex == pm->GetIndex()) {
pm->SetMarkerColor(GetMarkerColor());
AliPoints(const AliPoints& pts);
AliPoints(Int_t nhits);
virtual ~AliPoints();
- void Copy(AliPoints &pts) const;
virtual Int_t DistancetoPrimitive(Int_t px, Int_t py);
virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py);
AliDetector *GetDetector() const {return fDetector;}
virtual const Text_t *GetName() const;
virtual void InspectParticle(); // *MENU*
virtual void DumpParticle(); // *MENU*
- virtual Text_t *GetObjectInfo(Int_t px, Int_t py);
- AliPoints & operator=(const AliPoints &pts);
+ virtual Text_t *GetObjectInfo(Int_t px, Int_t py) const;
+ AliPoints & operator=(const AliPoints &pts)
+ {pts.Copy(*this); return (*this);}
virtual void Propagate(); // *MENU*
virtual void SetDetector(AliDetector *det) {fDetector = det;}
virtual void SetParticle(Int_t index) {fIndex = index;}
protected:
- AliDetector *fDetector; //Pointer to AliDetector object
- Int_t fIndex; //Particle number in AliRun::fParticles
+ void Copy(AliPoints &pts) const;
+
+ AliDetector *fDetector; //Pointer to AliDetector object
+ Int_t fIndex; //Particle number in AliRun::fParticles
ClassDef(AliPoints,1) //Class to draw detector hits (is PolyMarker3D)
};
/*
$Log$
+Revision 1.9 2001/12/05 14:36:47 hristov
+The default constructor now creates no objects; destructor corrected (thanks to R.Brun).
+
Revision 1.8 2001/10/21 18:38:43 hristov
Several pointers were set to zero in the default constructors to avoid memory management problems
ClassImp(AliRecPoint)
-//____________________________________________________________________________
-AliRecPoint::AliRecPoint()
+//_______________________________________________________________________
+AliRecPoint::AliRecPoint():
+ fAmp(0),
+ fGeom(0),
+ fIndexInList(-1), // to be set when the point is already stored
+ fLocPos(0,0,0),
+ fLocPosM(0),
+ fMaxDigit(100),
+ fMulDigit(0),
+ fMaxTrack(5),
+ fMulTrack(0),
+ fDigitsList(0),
+ fTracksList(0)
{
+ //
// default ctor
- fGeom = 0;
- fAmp = 0.0 ;
-
- fLocPos.SetXYZ(0., 0., 0.) ;
- fLocPosM = 0 ;
- fMaxDigit = 100 ;
- fMulDigit = 0 ;
- fDigitsList = 0 ;
- fMaxTrack = 5 ;
- fMulTrack = 0 ;
- fTracksList = 0 ;
- fIndexInList = -1 ; // to be set when the point is already stored
+ //
}
-//____________________________________________________________________________
-AliRecPoint::AliRecPoint(const char * opt)
+//_______________________________________________________________________
+AliRecPoint::AliRecPoint(const char * ):
+ fAmp(0),
+ fGeom(0),
+ fIndexInList(-1), // to be set when the point is already stored
+ fLocPos(0,0,0),
+ fLocPosM(new TMatrix(3,3)),
+ fMaxDigit(100),
+ fMulDigit(0),
+ fMaxTrack(5),
+ fMulTrack(0),
+ fDigitsList(new int[fMaxDigit]),
+ fTracksList(new int[fMaxTrack])
{
- // ctor
- fGeom = 0;
- fAmp = 0.0 ;
-
- fLocPos.SetXYZ(0., 0., 0.) ;
- fLocPosM = new TMatrix(3,3) ;
- fMaxDigit = 100 ;
- fMulDigit = 0 ;
- fDigitsList = new int[fMaxDigit];
- fMaxTrack = 5 ;
- fMulTrack = 0 ;
- fTracksList = new int[fMaxTrack]; ;
- fIndexInList = -1 ; // to be set when the point is already stored
+ //
+ // Standard ctor
+ //
}
-//____________________________________________________________________________
-AliRecPoint::AliRecPoint(const AliRecPoint& recp)
+//_______________________________________________________________________
+AliRecPoint::AliRecPoint(const AliRecPoint& recp):
+ TObject(recp),
+ fAmp(0),
+ fGeom(0),
+ fIndexInList(-1), // to be set when the point is already stored
+ fLocPos(0,0,0),
+ fLocPosM(0),
+ fMaxDigit(100),
+ fMulDigit(0),
+ fMaxTrack(5),
+ fMulTrack(0),
+ fDigitsList(0),
+ fTracksList(0)
{
//
// Copy constructor
recp.Copy(*this);
}
-//____________________________________________________________________________
+//_______________________________________________________________________
AliRecPoint::~AliRecPoint()
{
// dtor
}
-//____________________________________________________________________________
+//_______________________________________________________________________
void AliRecPoint::AddDigit(AliDigitNew & digit)
{
// adds a digit to the digits list
fAmp += digit.GetAmp() ;
}
-//____________________________________________________________________________
+//_______________________________________________________________________
// void AliRecPoint::AddTrack(AliTrack & track)
// {
// // adds a digit to the digits list
// fTracksList[fMulTrack++]= (int) &Track ;
// }
-//____________________________________________________________________________
+//_______________________________________________________________________
void AliRecPoint::Copy(AliRecPoint& recp) const
{
//
//
// Copy all first
if(this != &recp) {
- ((TObject*) this)->Copy((TObject&)recp);
+ ((TObject*) this)->Copy(dynamic_cast<TObject&>(recp));
recp.fAmp = fAmp;
recp.fGeom = fGeom;
recp.fIndexInList = fIndexInList;
}
}
-//____________________________________________________________________________
-void AliRecPoint::GetCovarianceMatrix(TMatrix & mat)
+//_______________________________________________________________________
+void AliRecPoint::GetCovarianceMatrix(TMatrix & mat) const
{
// returns the covariant matrix for the local position
}
-//____________________________________________________________________________
-AliRecPoint & AliRecPoint::operator= (const AliRecPoint &recp)
-{
- recp.Copy(*this);
- return (*this);
-}
-
-
//____________________________________________________________________________
void AliRecPoint::GetGlobalPosition(TVector3 & gpos, TMatrix & gmat) const
{
virtual void AddDigit(AliDigitNew & digit) ; // add a digit to the digit's indexes list
// virtual void AddTrack(AliTrack & track) ; // add a track to the tracks list
- void Copy(AliRecPoint &recp) const;
- virtual void GetCovarianceMatrix(TMatrix & mat) ;
+ virtual void GetCovarianceMatrix(TMatrix & mat) const;
virtual AliGeometry * GetGeom() const { return fGeom; }
virtual void GetGlobalPosition(TVector3 & gpos, TMatrix & gmat) const ; // return global position in ALICE
virtual int * GetDigitsList(void) const { return fDigitsList ; }
virtual Int_t GetMaximumDigitMultiplicity() const { return fMaxDigit; }
virtual Int_t GetMaximumTrackMultiplicity() const { return fMaxTrack; }
virtual Int_t GetTracksMultiplicity(void) const { return fMulTrack ; }
- //PH virtual void Print(Option_t * opt = "void") = 0 ;
- virtual void Print(Option_t * opt = "void") {;}
- AliRecPoint & operator= (const AliRecPoint &recp);
+ AliRecPoint & operator= (const AliRecPoint &recp)
+ {recp.Copy(*this); return (*this);}
+
void SetIndexInList(Int_t val) { fIndexInList = val ; }
protected:
+ void Copy(AliRecPoint &recp) const;
Float_t fAmp ; // summed amplitude of digits
AliGeometry * fGeom ; //! pointer to the geometry class
/*
$Log$
+Revision 1.3 2000/12/21 15:30:18 fca
+Correcting coding convention violations
+
Revision 1.2 2000/12/01 08:40:48 alibrary
Correction of a small bug - sRandom can be used now
// //
///////////////////////////////////////////////////////////////////////////////
-#include "TSystem.h"
#include "TFile.h"
+#include "TError.h"
+#include "TRandom3.h"
+#include "TSystem.h"
#include "AliRndm.h"
-#include "TRandom3.h"
ClassImp(AliRndm)
+//_______________________________________________________________________
+AliRndm::AliRndm():
+ fRandom(0)
+{
+ //
+ // Default ctor
+ //
+ SetRandom();
+}
+
+//_______________________________________________________________________
+AliRndm::AliRndm(const AliRndm& rn):
+ fRandom(0)
+{
+ //
+ // Copy constructor
+ //
+ rn.Copy(*this);
+}
+
+//_______________________________________________________________________
+void AliRndm::Copy(AliRndm&) const
+{
+ ::Fatal("Copy","Not implemented\n");
+}
+
//_____________________________________________________________________________
void AliRndm::Rndm(Float_t* array, const Int_t size) const
class AliRndm
{
public:
- AliRndm() {SetRandom();}
+ AliRndm();
+ AliRndm(const AliRndm &);
virtual ~AliRndm() {fRandom=sRandom=0;}
+ AliRndm & operator=(const AliRndm& rn)
+ {rn.Copy(*this); return (*this);}
// Random number generator bit
virtual void SetRandom(TRandom *ran=0)
virtual void WriteRandom(const char *filename) const;
virtual void ReadRandom(const char *filename);
- protected:
+protected:
TRandom *fRandom; // Pointer to the random number generator
- private:
- AliRndm(const AliRndm &) {}
- AliRndm & operator=(const AliRndm &) {return (*this);}
+private:
+ void Copy(AliRndm &rn) const;
ClassDef(AliRndm,1) //Random Number generator wrapper
};
/*
$Log$
+Revision 1.90 2002/10/22 15:02:15 alibrary
+Introducing Riostream.h
+
Revision 1.89 2002/10/17 16:26:39 hristov
Definition of additional particles moved to VMC (I.Hrivnacova)
ClassImp(AliRun)
-//_____________________________________________________________________________
-AliRun::AliRun()
- : TVirtualMCApplication()
+//_______________________________________________________________________
+AliRun::AliRun():
+ fRun(0),
+ fEvent(0),
+ fEventNrInRun(0),
+ fEventsPerRun(0),
+ fDebug(0),
+ fHeader(0),
+ fTreeD(0),
+ fTreeS(0),
+ fTreeH(0),
+ fTreeTR(0),
+ fTreeE(0),
+ fTreeR(0),
+ fModules(0),
+ fGeometry(0),
+ fDisplay(0),
+ fTimer(),
+ fField(0),
+ fMC(0),
+ fImedia(0),
+ fNdets(0),
+ fTrRmax(1.e10),
+ fTrZmax(1.e10),
+ fGenerator(0),
+ fInitDone(kFALSE),
+ fLego(0),
+ fPDGDB(0), //Particle factory object
+ fHitLists(0),
+ fEventEnergy(0),
+ fSummEnergy(0),
+ fSum2Energy(0),
+ fConfigFunction("\0"),
+ fRandom(0),
+ fMCQA(0),
+ fTransParName("\0"),
+ fBaseFileName("\0"),
+ fStack(0),
+ fTreeDFileName(""),
+ fTreeDFile(0),
+ fTreeSFileName(""),
+ fTreeSFile(0),
+ fTreeRFileName(""),
+ fTreeRFile(0)
{
//
// Default constructor for AliRun
//
- fHeader = 0;
- fRun = 0;
- fEvent = 0;
- fEventNrInRun = 0;
- fStack = 0;
- fModules = 0;
- fGenerator = 0;
- fTreeD = 0;
- fTreeH = 0;
- fTreeTR = 0;
- fTreeE = 0;
- fTreeR = 0;
- fTreeS = 0;
- fGeometry = 0;
- fDisplay = 0;
- fField = 0;
- fMC = 0;
- fNdets = 0;
- fImedia = 0;
- fTrRmax = 1.e10;
- fTrZmax = 1.e10;
- fInitDone = kFALSE;
- fLego = 0;
- fPDGDB = 0; //Particle factory object!
- fHitLists = 0;
- fConfigFunction = "\0";
- fRandom = 0;
- fMCQA = 0;
- fTransParName = "\0";
- fBaseFileName = ".\0";
- fDebug = 0;
- fTreeDFile = 0;
- fTreeSFileName = "";
- fTreeSFile = 0;
- fTreeSFileName = "";
- fTreeRFile = 0;
- fTreeRFileName = "";
+}
+
+//_______________________________________________________________________
+AliRun::AliRun(const AliRun& arun):
+ TVirtualMCApplication(arun),
+ fRun(0),
+ fEvent(0),
+ fEventNrInRun(0),
+ fEventsPerRun(0),
+ fDebug(0),
+ fHeader(0),
+ fTreeD(0),
+ fTreeS(0),
+ fTreeH(0),
+ fTreeTR(0),
+ fTreeE(0),
+ fTreeR(0),
+ fModules(0),
+ fGeometry(0),
+ fDisplay(0),
+ fTimer(),
+ fField(0),
+ fMC(0),
+ fImedia(0),
+ fNdets(0),
+ fTrRmax(1.e10),
+ fTrZmax(1.e10),
+ fGenerator(0),
+ fInitDone(kFALSE),
+ fLego(0),
+ fPDGDB(0), //Particle factory object
+ fHitLists(0),
+ fEventEnergy(0),
+ fSummEnergy(0),
+ fSum2Energy(0),
+ fConfigFunction("\0"),
+ fRandom(0),
+ fMCQA(0),
+ fTransParName("\0"),
+ fBaseFileName("\0"),
+ fStack(0),
+ fTreeDFileName(""),
+ fTreeDFile(0),
+ fTreeSFileName(""),
+ fTreeSFile(0),
+ fTreeRFileName(""),
+ fTreeRFile(0)
+{
+ //
+ // Copy constructor for AliRun
+ //
+ arun.Copy(*this);
}
//_____________________________________________________________________________
-AliRun::AliRun(const char *name, const char *title)
- : TVirtualMCApplication(name,title)
+AliRun::AliRun(const char *name, const char *title):
+ TVirtualMCApplication(name,title),
+ fRun(0),
+ fEvent(0),
+ fEventNrInRun(0),
+ fEventsPerRun(0),
+ fDebug(0),
+ fHeader(new AliHeader()),
+ fTreeD(0),
+ fTreeS(0),
+ fTreeH(0),
+ fTreeTR(0),
+ fTreeE(0),
+ fTreeR(0),
+ fModules(new TObjArray(77)), // Support list for the Detectors
+ fGeometry(0),
+ fDisplay(0),
+ fTimer(),
+ fField(0),
+ fMC(gMC),
+ fImedia(new TArrayI(1000)),
+ fNdets(0),
+ fTrRmax(1.e10),
+ fTrZmax(1.e10),
+ fGenerator(0),
+ fInitDone(kFALSE),
+ fLego(0),
+ fPDGDB(TDatabasePDG::Instance()), //Particle factory object!
+ fHitLists(new TList()), // Create HitLists list
+ fEventEnergy(0),
+ fSummEnergy(0),
+ fSum2Energy(0),
+ fConfigFunction("Config();"),
+ fRandom(new TRandom3()),
+ fMCQA(0),
+ fTransParName("\0"),
+ fBaseFileName("\0"),
+ fStack(new AliStack(10000)), //Particle stack
+ fTreeDFileName(""),
+ fTreeDFile(0),
+ fTreeSFileName(""),
+ fTreeSFile(0),
+ fTreeRFileName(""),
+ fTreeRFile(0)
{
//
// Constructor for the main processor.
// Creates the list of Detectors.
// Creates the list of particles.
//
- Int_t i;
-
+
gAlice = this;
- fTreeD = 0;
- fTreeH = 0;
- fTreeTR = 0;
- fTreeE = 0;
- fTreeR = 0;
- fTreeS = 0;
- fTrRmax = 1.e10;
- fTrZmax = 1.e10;
- fGenerator = 0;
- fInitDone = kFALSE;
- fLego = 0;
- fField = 0;
- fConfigFunction = "Config();";
- fTreeDFile = 0;
- fTreeSFileName = "";
- fTreeSFile = 0;
- fTreeSFileName = "";
- fTreeRFile = 0;
- fTreeRFileName = "";
// Set random number generator
- gRandom = fRandom = new TRandom3();
+ gRandom = fRandom;
if (gSystem->Getenv("CONFIG_SEED")) {
- gRandom->SetSeed((UInt_t)atoi(gSystem->Getenv("CONFIG_SEED")));
+ gRandom->SetSeed(static_cast<UInt_t>(atoi(gSystem->Getenv("CONFIG_SEED"))));
}
-
+
+ // Add to list of browsable
gROOT->GetListOfBrowsables()->Add(this,name);
- //
- // Particle stack
- fStack = new AliStack(10000);
- // create the support list for the various Detectors
- fModules = new TObjArray(77);
- //
+
// Create the TNode geometry for the event display
-
BuildSimpleGeometry();
- fHeader = new AliHeader();
- fRun = 0;
- fEvent = 0;
- fEventNrInRun = 0;
- //
- fDisplay = 0;
- //
// Create default mag field
SetField();
- //
- fMC = gMC;
- //
+
// Prepare the tracking medium lists
- fImedia = new TArrayI(1000);
- for(i=0;i<1000;i++) (*fImedia)[i]=-99;
- //
- // Make particles
- fPDGDB = TDatabasePDG::Instance(); //Particle factory object!
+ for(Int_t i=0;i<1000;i++) (*fImedia)[i]=-99;
+ // Add particle list to configuration
AliConfig::Instance()->Add(fPDGDB);
- //
- // Create HitLists list
- fHitLists = new TList();
- //
+
+ // Set transport parameters
SetTransPar();
- fBaseFileName = ".\0";
- //
- fDebug = 0;
}
-//_____________________________________________________________________________
+//_______________________________________________________________________
AliRun::~AliRun()
{
//
gAlice=0;
}
-//_____________________________________________________________________________
+//_______________________________________________________________________
+void AliRun::Copy(AliRun &) const
+{
+ Fatal("Copy","Not implemented!\n");
+}
+
+//_______________________________________________________________________
void AliRun::AddHit(Int_t id, Int_t track, Int_t *vol, Float_t *hits) const
{
//
// Add a hit to detector id
//
TObjArray &dets = *fModules;
- if(dets[id]) ((AliModule*) dets[id])->AddHit(track,vol,hits);
+ if(dets[id]) dynamic_cast<AliModule*>(dets[id])->AddHit(track,vol,hits);
}
-//_____________________________________________________________________________
+//_______________________________________________________________________
void AliRun::AddDigit(Int_t id, Int_t *tracks, Int_t *digits) const
{
//
// Add digit to detector id
//
TObjArray &dets = *fModules;
- if(dets[id]) ((AliModule*) dets[id])->AddDigit(tracks,digits);
+ if(dets[id]) dynamic_cast<AliModule*>(dets[id])->AddDigit(tracks,digits);
}
-//_____________________________________________________________________________
+//_______________________________________________________________________
void AliRun::Browse(TBrowser *b)
{
//
TIter next(fModules);
AliModule *detector;
- while((detector = (AliModule*)next())) {
+ while((detector = dynamic_cast<AliModule*>(next()))) {
b->Add(detector,detector->GetName());
}
b->Add(fMCQA,"AliMCQA");
}
-//_____________________________________________________________________________
+//_______________________________________________________________________
void AliRun::Build()
{
//
//
}
-//_____________________________________________________________________________
+//_______________________________________________________________________
void AliRun::BuildSimpleGeometry()
{
//
new TNode("alice","alice","S_alice");
}
-//_____________________________________________________________________________
+//_______________________________________________________________________
void AliRun::CleanDetectors()
{
//
//
TIter next(fModules);
AliModule *detector;
- while((detector = (AliModule*)next())) {
+ while((detector = dynamic_cast<AliModule*>(next()))) {
detector->FinishEvent();
}
}
-//_____________________________________________________________________________
+//_______________________________________________________________________
Int_t AliRun::DistancetoPrimitive(Int_t, Int_t)
{
//
return 9999;
}
-//_____________________________________________________________________________
+//_______________________________________________________________________
void AliRun::DumpPart (Int_t i) const
{
//
fStack->DumpPart(i);
}
-//_____________________________________________________________________________
+//_______________________________________________________________________
void AliRun::DumpPStack () const
{
//
fStack->DumpPStack();
}
-//_____________________________________________________________________________
+//_______________________________________________________________________
void AliRun::SetField(AliMagF* magField)
{
// Set Magnetic Field Map
fField->ReadField();
}
-//_____________________________________________________________________________
+//_______________________________________________________________________
void AliRun::SetField(Int_t type, Int_t version, Float_t scale,
Float_t maxField, char* filename)
{
}
}
-//_____________________________________________________________________________
+//_______________________________________________________________________
void AliRun::FinishRun()
{
//
// Clean detector information
TIter next(fModules);
AliModule *detector;
- while((detector = (AliModule*)next())) {
+ while((detector = dynamic_cast<AliModule*>(next()))) {
detector->FinishRun();
}
file->Write();
}
-//_____________________________________________________________________________
+//_______________________________________________________________________
void AliRun::FlagTrack(Int_t track)
{
// Delegate to stack
fStack->FlagTrack(track);
}
-//_____________________________________________________________________________
+//_______________________________________________________________________
void AliRun::EnergySummary()
{
//
} else
ed2=99;
fSummEnergy[ndep]=ed;
- fSum2Energy[ndep]=TMath::Min((Float_t) 99.,TMath::Max(ed2,kzero));
+ fSum2Energy[ndep]=TMath::Min(static_cast<Float_t>(99.),TMath::Max(ed2,kzero));
edtot+=ed;
ndep++;
}
// fSum2Energy.Set(0);
}
-//_____________________________________________________________________________
+//_______________________________________________________________________
AliModule *AliRun::GetModule(const char *name) const
{
//
// Return pointer to detector from name
//
- return (AliModule*)fModules->FindObject(name);
+ return dynamic_cast<AliModule*>(fModules->FindObject(name));
}
-//_____________________________________________________________________________
+//_______________________________________________________________________
AliDetector *AliRun::GetDetector(const char *name) const
{
//
// Return pointer to detector from name
//
- return (AliDetector*)fModules->FindObject(name);
+ return dynamic_cast<AliDetector*>(fModules->FindObject(name));
}
-//_____________________________________________________________________________
+//_______________________________________________________________________
Int_t AliRun::GetModuleID(const char *name) const
{
//
return i;
}
-//_____________________________________________________________________________
+//_______________________________________________________________________
Int_t AliRun::GetEvent(Int_t event)
{
//
// Get Hits Tree header from file
sprintf(treeName,"TreeH%d",event);
- fTreeH = (TTree*)gDirectory->Get(treeName);
+ fTreeH = dynamic_cast<TTree*>(gDirectory->Get(treeName));
if (!fTreeH) {
Warning("GetEvent","cannot find Hits Tree for event:%d\n",event);
}
// Get TracReferences Tree header from file
sprintf(treeName,"TreeTR%d",event);
- fTreeTR = (TTree*)gDirectory->Get(treeName);
+ fTreeTR = dynamic_cast<TTree*>(gDirectory->Get(treeName));
if (!fTreeTR) {
Warning("GetEvent","cannot find TrackReferences Tree for event:%d\n",event);
}
// get current file name and compare with names containing trees S,D,R
- TString curfilname=(TString)fTreeE->GetCurrentFile()->GetName();
+ TString curfilname=static_cast<TString>(fTreeE->GetCurrentFile()->GetName());
if(fTreeDFileName==curfilname)fTreeDFileName="";
if(fTreeSFileName==curfilname)fTreeSFileName="";
if(fTreeRFileName==curfilname)fTreeRFileName="";
InitTreeFile("D",fTreeDFileName);
}
if (fTreeDFile) {
- fTreeD = (TTree*)fTreeDFile->Get(treeName);
+ fTreeD = dynamic_cast<TTree*>(fTreeDFile->Get(treeName));
} else {
- fTreeD = (TTree*)file->Get(treeName);
+ fTreeD = dynamic_cast<TTree*>(file->Get(treeName));
}
if (!fTreeD) {
// Warning("GetEvent","cannot find Digits Tree for event:%d\n",event);
InitTreeFile("S",fTreeSFileName);
}
if (fTreeSFile) {
- fTreeS = (TTree*)fTreeSFile->Get(treeName);
+ fTreeS = dynamic_cast<TTree*>(fTreeSFile->Get(treeName));
} else {
- fTreeS = (TTree*)gDirectory->Get(treeName);
+ fTreeS = dynamic_cast<TTree*>(gDirectory->Get(treeName));
}
if (!fTreeS) {
// Warning("GetEvent","cannot find SDigits Tree for event:%d\n",event);
InitTreeFile("R",fTreeRFileName);
}
if(fTreeRFile) {
- fTreeR = (TTree*)fTreeRFile->Get(treeName);
+ fTreeR = dynamic_cast<TTree*>(fTreeRFile->Get(treeName));
} else {
- fTreeR = (TTree*)gDirectory->Get(treeName);
+ fTreeR = dynamic_cast<TTree*>(gDirectory->Get(treeName));
}
if (!fTreeR) {
// printf("WARNING: cannot find Reconstructed Tree for event:%d\n",event);
// Set Trees branch addresses
TIter next(fModules);
AliModule *detector;
- while((detector = (AliModule*)next())) {
+ while((detector = dynamic_cast<AliModule*>(next()))) {
detector->SetTreeAddress();
}
return fHeader->GetNtrack();
}
-//_____________________________________________________________________________
+//_______________________________________________________________________
TGeometry *AliRun::GetGeometry()
{
//
// Import Alice geometry from current file
// Return pointer to geometry object
//
- if (!fGeometry) fGeometry = (TGeometry*)gDirectory->Get("AliceGeom");
+ if (!fGeometry) fGeometry = dynamic_cast<TGeometry*>(gDirectory->Get("AliceGeom"));
//
// Unlink and relink nodes in detectors
// This is bad and there must be a better way...
TIter next(fModules);
AliModule *detector;
- while((detector = (AliModule*)next())) {
+ while((detector = dynamic_cast<AliModule*>(next()))) {
TList *dnodes=detector->Nodes();
Int_t j;
TNode *node, *node1;
for ( j=0; j<dnodes->GetSize(); j++) {
- node = (TNode*) dnodes->At(j);
+ node = dynamic_cast<TNode*>(dnodes->At(j));
node1 = fGeometry->GetNode(node->GetName());
dnodes->Remove(node);
dnodes->AddAt(node1,j);
return fGeometry;
}
-//_____________________________________________________________________________
+//_______________________________________________________________________
Int_t AliRun::GetPrimary(Int_t track) const
{
//
return fStack->GetPrimary(track);
}
-//_____________________________________________________________________________
+//_______________________________________________________________________
void AliRun::MediaTable()
{
//
// For all detectors
for (kz=0;kz<fNdets;kz++) {
// If detector is defined
- if((det=(AliModule*) dets[kz])) {
+ if((det=dynamic_cast<AliModule*>(dets[kz]))) {
TArrayI &idtmed = *(det->GetIdtmed());
for(nz=0;nz<100;nz++) {
// Find max and min material number
for(i=0;i<(fNdets-1)/6+1;i++) {
for(k=0;k< (6<fNdets-i*6?6:fNdets-i*6);k++) {
ind=i*6+k;
- det=(AliModule*)dets[ind];
+ det=dynamic_cast<AliModule*>(dets[ind]);
if(det)
printf(" %6s: %3d -> %3d;",det->GetName(),det->LoMedium(),
det->HiMedium());
}
}
-//____________________________________________________________________________
+//_______________________________________________________________________
void AliRun::SetGenerator(AliGenerator *generator)
{
//
if(!fGenerator) fGenerator = generator;
}
-//____________________________________________________________________________
+//_______________________________________________________________________
void AliRun::ResetGenerator(AliGenerator *generator)
{
//
fGenerator = generator;
}
-//____________________________________________________________________________
-void AliRun::SetTransPar(char *filename)
+//_______________________________________________________________________
+void AliRun::SetTransPar(const char *filename)
{
fTransParName = filename;
}
-//____________________________________________________________________________
-void AliRun::SetBaseFile(char *filename)
+//_______________________________________________________________________
+void AliRun::SetBaseFile(const char *filename)
{
fBaseFileName = filename;
}
-//____________________________________________________________________________
+//_______________________________________________________________________
void AliRun::ReadTransPar()
{
//
}
-//_____________________________________________________________________________
+//_______________________________________________________________________
void AliRun::MakeTree(Option_t *option, const char *file)
{
//
// branch = fTreeE->Branch("Header", "AliHeader", &fHeader, 4000, 0);
branch = fTreeE->Branch("Header", "AliHeader", &fHeader, 4000, 0);
branch->SetAutoDelete(kFALSE);
- TFolder *folder = (TFolder *)gROOT->FindObjectAny("/Folders/RunMC/Event/Header");
+ TFolder *folder = dynamic_cast<TFolder *>(gROOT->FindObjectAny("/Folders/RunMC/Event/Header"));
if (folder) folder->Add(fHeader);
// branch = fTreeE->Branch("Stack","AliStack", &fStack, 4000, 0);
// branch->SetAutoDelete(kFALSE);
sprintf(outFile,"%s/%s",GetBaseFile(),file);
branch->SetFile(outFile);
TIter next( branch->GetListOfBranches());
- while ((branch=(TBranch*)next())) {
+ while ((branch=dynamic_cast<TBranch*>(next()))) {
branch->SetFile(outFile);
}
if (GetDebug()>1)
// will be in turn a subbranch of the detector master branch
TIter next(fModules);
AliModule *detector;
- while((detector = (AliModule*)next())) {
+ while((detector = dynamic_cast<AliModule*>(next()))) {
if (oH) detector->MakeBranch(option,file);
if (oTR) detector->MakeBranchTR(option,file);
}
}
-//_____________________________________________________________________________
+//_______________________________________________________________________
TParticle* AliRun::Particle(Int_t i)
{
return fStack->Particle(i);
}
-//_____________________________________________________________________________
+//_______________________________________________________________________
void AliRun::ResetDigits()
{
//
//
TIter next(fModules);
AliModule *detector;
- while((detector = (AliModule*)next())) {
+ while((detector = dynamic_cast<AliModule*>(next()))) {
detector->ResetDigits();
}
}
-//_____________________________________________________________________________
+//_______________________________________________________________________
void AliRun::ResetSDigits()
{
//
//
TIter next(fModules);
AliModule *detector;
- while((detector = (AliModule*)next())) {
+ while((detector = dynamic_cast<AliModule*>(next()))) {
detector->ResetSDigits();
}
}
-//_____________________________________________________________________________
+//_______________________________________________________________________
void AliRun::ResetHits()
{
//
//
TIter next(fModules);
AliModule *detector;
- while((detector = (AliModule*)next())) {
+ while((detector = dynamic_cast<AliModule*>(next()))) {
detector->ResetHits();
}
}
-//_____________________________________________________________________________
+//_______________________________________________________________________
void AliRun::ResetTrackReferences()
{
//
//
TIter next(fModules);
AliModule *detector;
- while((detector = (AliModule*)next())) {
+ while((detector = dynamic_cast<AliModule*>(next()))) {
detector->ResetTrackReferences();
}
}
-//_____________________________________________________________________________
+//_______________________________________________________________________
void AliRun::ResetPoints()
{
//
//
TIter next(fModules);
AliModule *detector;
- while((detector = (AliModule*)next())) {
+ while((detector = dynamic_cast<AliModule*>(next()))) {
detector->ResetPoints();
}
}
-//_____________________________________________________________________________
+//_______________________________________________________________________
void AliRun::InitMC(const char *setup)
{
//
TIter next(fModules);
AliModule *detector;
- while((detector = (AliModule*)next())) {
+ while((detector = dynamic_cast<AliModule*>(next()))) {
detector->SetTreeAddress();
objlast = gDirectory->GetList()->Last();
Write();
}
-//_____________________________________________________________________________
+//_______________________________________________________________________
void AliRun::RunMC(Int_t nevent, const char *setup)
{
//
if(nevent>0) FinishRun();
}
-//_____________________________________________________________________________
+//_______________________________________________________________________
void AliRun::RunReco(const char *selected, Int_t first, Int_t last)
{
//
//
cout << "Found "<< gAlice->TreeE()->GetEntries() << "events" << endl;
Int_t nFirst = first;
- Int_t nLast = (last < 0)? (Int_t) gAlice->TreeE()->GetEntries() : last;
+ Int_t nLast = (last < 0)? static_cast<Int_t>(gAlice->TreeE()->GetEntries()) : last;
for (Int_t nevent = nFirst; nevent <= nLast; nevent++) {
cout << "Processing event "<< nevent << endl;
}
}
-//_____________________________________________________________________________
+//_______________________________________________________________________
void AliRun::Hits2Digits(const char *selected)
{
}
-//_____________________________________________________________________________
+//_______________________________________________________________________
void AliRun::Tree2Tree(Option_t *option, const char *selected)
{
char outFile[32];
- while((detector = (AliDetector*)next())) {
+ while((detector = dynamic_cast<AliDetector*>(next()))) {
if (selected)
if (strcmp(detector->GetName(),selected)) continue;
if (detector->IsActive()){
}
-//_____________________________________________________________________________
+//_______________________________________________________________________
void AliRun::RunLego(const char *setup, Int_t nc1, Float_t c1min,
Float_t c1max,Int_t nc2,Float_t c2min,Float_t c2max,
Float_t rmin,Float_t rmax,Float_t zmax, AliLegoGenerator* gener)
delete fLego; fLego=0;
}
-//_____________________________________________________________________________
+//_______________________________________________________________________
void AliRun::SetConfigFunction(const char * config)
{
//
fConfigFunction=config;
}
-//_____________________________________________________________________________
+//_______________________________________________________________________
void AliRun::SetCurrentTrack(Int_t track)
{
//
fStack->SetCurrentTrack(track);
}
-//_____________________________________________________________________________
+//_______________________________________________________________________
void AliRun::SetTrack(Int_t done, Int_t parent, Int_t pdg, Float_t *pmom,
Float_t *vpos, Float_t *polar, Float_t tof,
AliMCProcess mech, Int_t &ntr, Float_t weight, Int_t is)
mech, ntr, weight, is);
}
-//_____________________________________________________________________________
+//_______________________________________________________________________
void AliRun::SetTrack(Int_t done, Int_t parent, Int_t pdg,
Double_t px, Double_t py, Double_t pz, Double_t e,
Double_t vx, Double_t vy, Double_t vz, Double_t tof,
}
-//_____________________________________________________________________________
+//_______________________________________________________________________
void AliRun::SetHighWaterMark(const Int_t nt)
{
//
fStack->SetHighWaterMark(nt);
}
-//_____________________________________________________________________________
+//_______________________________________________________________________
void AliRun::KeepTrack(const Int_t track)
{
//
// MC Application
//
-//_____________________________________________________________________________
+//_______________________________________________________________________
void AliRun::ConstructGeometry()
{
//
TIter next(fModules);
AliModule *detector;
printf("Geometry creation:\n");
- while((detector = (AliModule*)next())) {
+ while((detector = dynamic_cast<AliModule*>(next()))) {
stw.Start();
// Initialise detector materials and geometry
detector->CreateMaterials();
}
}
-//_____________________________________________________________________________
+//_______________________________________________________________________
void AliRun::InitGeometry()
{
//
TStopwatch stw;
TIter next(fModules);
AliModule *detector;
- while((detector = (AliModule*)next())) {
+ while((detector = dynamic_cast<AliModule*>(next()))) {
stw.Start();
// Initialise detector and display geometry
detector->Init();
}
-//_____________________________________________________________________________
+//_______________________________________________________________________
void AliRun::GeneratePrimaries()
{
//
Generator()->Generate();
}
-//_____________________________________________________________________________
+//_______________________________________________________________________
void AliRun::BeginEvent()
{
// Clean-up previous event
}
}
-//_____________________________________________________________________________
+//_______________________________________________________________________
void AliRun::BeginPrimary()
{
//
}
-//_____________________________________________________________________________
+//_______________________________________________________________________
void AliRun::PreTrack()
{
TObjArray &dets = *fModules;
AliModule *module;
for(Int_t i=0; i<=fNdets; i++)
- if((module = (AliModule*)dets[i]))
+ if((module = dynamic_cast<AliModule*>(dets[i])))
module->PreTrack();
fMCQA->PreTrack();
}
-//_____________________________________________________________________________
+//_______________________________________________________________________
void AliRun::Stepping()
{
//
AddEnergyDeposit(gMC->CurrentVolID(copy),gMC->Edep());
//Call the appropriate stepping routine;
- AliModule *det = (AliModule*)fModules->At(id);
+ AliModule *det = dynamic_cast<AliModule*>(fModules->At(id));
if(det && det->StepManagerIsEnabled()) {
fMCQA->StepManager(id);
det->StepManager();
}
}
-//_____________________________________________________________________________
+//_______________________________________________________________________
void AliRun::PostTrack()
{
TObjArray &dets = *fModules;
AliModule *module;
for(Int_t i=0; i<=fNdets; i++)
- if((module = (AliModule*)dets[i]))
+ if((module = dynamic_cast<AliModule*>(dets[i])))
module->PostTrack();
}
-//_____________________________________________________________________________
+//_______________________________________________________________________
void AliRun::FinishPrimary()
{
//
TIter next(fModules);
AliModule *detector;
- while((detector = (AliModule*)next())) {
+ while((detector = dynamic_cast<AliModule*>(next()))) {
detector->FinishPrimary();
}
// if(++count%times==1) gObjectTable->Print();
}
-//_____________________________________________________________________________
+//_______________________________________________________________________
void AliRun::FinishEvent()
{
//
++fEventNrInRun;
}
-//_____________________________________________________________________________
+//_______________________________________________________________________
void AliRun::Field(const Double_t* x, Double_t *b) const
{
Float_t xfloat[3];
// End of MC Application
//
-//_____________________________________________________________________________
+//_______________________________________________________________________
void AliRun::Streamer(TBuffer &R__b)
{
// Stream an object of class AliRun.
//
gROOT->GetListOfBrowsables()->Add(this,"Run");
- fTreeE = (TTree*)gDirectory->Get("TE");
+ fTreeE = dynamic_cast<TTree*>(gDirectory->Get("TE"));
if (fTreeE) {
fTreeE->SetBranchAddress("Header", &fHeader);
}
}
-//___________________________________________________________________________
+//_______________________________________________________________________
Int_t AliRun::CurrentTrack() const {
//
// Returns current track
return fStack->CurrentTrack();
}
-//___________________________________________________________________________
+//_______________________________________________________________________
Int_t AliRun::GetNtrack() const {
//
// Returns number of tracks in stack
return fStack->GetNtrack();
}
-//___________________________________________________________________________
+//_______________________________________________________________________
TObjArray* AliRun::Particles() {
//
// Returns pointer to Particles array
return fStack->Particles();
}
-//___________________________________________________________________________
+//_______________________________________________________________________
TTree* AliRun::TreeK() {
//
// Returns pointer to the TreeK array
}
-//___________________________________________________________________________
+//_______________________________________________________________________
void AliRun::SetGenEventHeader(AliGenEventHeader* header)
{
fHeader->SetGenEventHeader(header);
}
-//___________________________________________________________________________
+//_______________________________________________________________________
TFile* AliRun::InitFile(TString fileName)
{
//
return file;
}
-//___________________________________________________________________________
+//_______________________________________________________________________
TFile* AliRun::InitTreeFile(Option_t *option, TString fileName)
{
//
return 0;
}
-//___________________________________________________________________________
+//_______________________________________________________________________
void AliRun::PrintTreeFile()
{
//
cout<<"===================================================\n";
TFile *file = fTreeE->GetCurrentFile();
TString curfilname="";
- if(file)curfilname=(TString)file->GetName();
+ if(file)curfilname=static_cast<TString>(file->GetName());
cout<<" Current tree file name: "<<curfilname<<endl;
cout<<"Pointer: "<<file<<endl;
cout<<" Tree S File name: "<<fTreeSFileName<<endl;
cout<<"Pointer: "<<fTreeRFile<<endl<<endl;
cout<<"===================================================\n";
}
-//___________________________________________________________________________
+//_______________________________________________________________________
void AliRun::CloseTreeFile(Option_t *option)
{
//
}
}
-//___________________________________________________________________________
+//_______________________________________________________________________
void AliRun::MakeTree(Option_t *option, TFile *file)
{
//
/* $Id$ */
-class TBrowser;
-class TList;
-class TTree;
-class TBranch;
-class TGeometry;
-class TDatabasePDG;
-class TRandom;
-class TParticle;
-class TFile;
-#include <TArrayI.h>
-#include "TClonesArray.h"
+#include <TClonesArray.h>
#include <TArrayF.h>
+#include <TArrayI.h>
#include <TStopwatch.h>
#include <TVirtualMCApplication.h>
+class TBranch;
+class TBrowser;
+class TDatabasePDG;
+class TFile;
+class TGeometry;
+class TList;
+class TParticle;
+class TRandom;
+class TTree;
#include "AliMC.h"
+#include "AliMCProcess.h"
class AliDetector;
-class AliModule;
-class AliMagF;
-//class AliMC;
-class AliLego;
class AliDisplay;
-class AliLegoGenerator;
-class AliHeader;
+class AliGenEventHeader;
class AliGenerator;
+class AliHeader;
+class AliLego;
+class AliLegoGenerator;
class AliLegoGenerator;
-#include "AliMCProcess.h"
class AliMCQA;
+class AliMagF;
+class AliModule;
class AliStack;
-class AliGenEventHeader;
enum {kKeepBit=1, kDaughtersBit=2, kDoneBit=4};
// Creators - distructors
AliRun();
AliRun(const char *name, const char *title);
+ AliRun(const AliRun &arun);
virtual ~AliRun();
+ AliRun& operator = (const AliRun &arun)
+ {arun.Copy(*this); return (*this);}
virtual void AddHit(Int_t id, Int_t track, Int_t *vol, Float_t *hits) const;
virtual void AddDigit(Int_t id, Int_t *tracks, Int_t *digits) const;
virtual void AddHitList(TCollection *hitList) {fHitLists->Add(hitList);}
virtual void ResetHits();
virtual void ResetTrackReferences();
virtual void ResetPoints();
- virtual void SetTransPar(char *filename="$(ALICE_ROOT)/data/galice.cuts");
- virtual void SetBaseFile(char *filename="galice.root");
+ virtual void SetTransPar(const char *filename="$(ALICE_ROOT)/data/galice.cuts");
+ virtual void SetBaseFile(const char *filename="galice.root");
virtual void ReadTransPar();
virtual void RunMC(Int_t nevent=1, const char *setup="Config.C");
virtual void Run(Int_t nevent=1, const char *setup="Config.C")
TFile* fTreeRFile; //! file with TreeR
private:
+ void Copy(AliRun &arun) const;
- AliRun(const AliRun &right)
- {}
- AliRun& operator = (const AliRun &) {return *this;}
- ClassDef(AliRun,7) //Supervisor class for all Alice detectors
+ ClassDef(AliRun,7) //Supervisor class for all Alice detectors
};
R__EXTERN AliRun *gAlice;
/*
$Log$
+Revision 1.21 2002/10/22 15:02:15 alibrary
+Introducing Riostream.h
+
Revision 1.20 2002/10/14 14:57:32 hristov
Merging the VirtualMC branch to the main development branch (HEAD)
// ROOT includes
#include "TFile.h"
-#include "TTree.h"
#include "TList.h"
+#include "TParticle.h"
+#include "TTree.h"
// AliROOT includes
-#include "AliRunDigitizer.h"
#include "AliDigitizer.h"
-#include "AliRun.h"
#include "AliHeader.h"
-#include "TParticle.h"
-#include "AliStream.h"
#include "AliMergeCombi.h"
+#include "AliRun.h"
+#include "AliRunDigitizer.h"
+#include "AliStream.h"
ClassImp(AliRunDigitizer)
-////////////////////////////////////////////////////////////////////////
-AliRunDigitizer::AliRunDigitizer()
+//_______________________________________________________________________
+AliRunDigitizer::AliRunDigitizer():
+ fkMASKSTEP(0),
+ fOutputFileName(0),
+ fOutputDirName(0),
+ fOutput(0),
+ fEvent(0),
+ fNrOfEventsToWrite(0),
+ fNrOfEventsWritten(0),
+ fCopyTreesFromInput(0),
+ fTreeD(0),
+ fTreeDTPC(0),
+ fTreeDTRD(0),
+ fTreeR(0),
+ fNinputs(0),
+ fNinputsGiven(0),
+ fInputStreams(0),
+ fTreeDTPCBaseName(0),
+ fTreeTPCSBaseName(0),
+ fCombi(0),
+ fCombination(0),
+ fCombinationFileName(0),
+ fDebug(0)
{
-// root requires default ctor, where no new objects can be created
-// do not use this ctor, it is supplied only for root needs
-
-// just set all pointers - data members to 0
- fOutput = 0;
- fTreeD = 0;
- fTreeR = 0;
- fTreeDTPC = 0;
- fTreeDTRD = 0;
- fInputStreams = 0;
+ //
+ // default ctor, where no new objects can be created
+ // do not use this ctor, it is supplied only for root needs
+ //
for (Int_t i=0;i<kMaxStreamsToMerge;i++) {
fArrayTreeS[i]=fArrayTreeH[i]=fArrayTreeTPCS[i]=fArrayTreeTRDS[i]=NULL;
fInputFiles[i]=0;
}
- fCombi = 0;
+}
+//_______________________________________________________________________
+AliRunDigitizer::AliRunDigitizer(const AliRunDigitizer& dig):
+ TTask(dig),
+ fkMASKSTEP(0),
+ fOutputFileName(0),
+ fOutputDirName(0),
+ fOutput(0),
+ fEvent(0),
+ fNrOfEventsToWrite(0),
+ fNrOfEventsWritten(0),
+ fCopyTreesFromInput(0),
+ fTreeD(0),
+ fTreeDTPC(0),
+ fTreeDTRD(0),
+ fTreeR(0),
+ fNinputs(0),
+ fNinputsGiven(0),
+ fInputStreams(0),
+ fTreeDTPCBaseName(0),
+ fTreeTPCSBaseName(0),
+ fCombi(0),
+ fCombination(0),
+ fCombinationFileName(0),
+ fDebug(0)
+{
+ //
+ // Copy ctor
+ //
+ dig.Copy(*this);
}
-////////////////////////////////////////////////////////////////////////
-AliRunDigitizer::AliRunDigitizer(Int_t nInputStreams, Int_t sperb) : TTask("AliRunDigitizer","The manager for Merging")
+//_______________________________________________________________________
+void AliRunDigitizer::Copy(AliRunDigitizer&) const
{
-// ctor which should be used to create a manager for merging/digitization
+ Fatal("Copy","Not installed\n");
+}
+
+
+//_______________________________________________________________________
+AliRunDigitizer::AliRunDigitizer(Int_t nInputStreams, Int_t sperb):
+ TTask("AliRunDigitizer","The manager for Merging"),
+ fkMASKSTEP(10000000),
+ fOutputFileName(""),
+ fOutputDirName("."),
+ fOutput(0),
+ fEvent(0),
+ fNrOfEventsToWrite(-1),
+ fNrOfEventsWritten(0),
+ fCopyTreesFromInput(-1),
+ fTreeD(0),
+ fTreeDTPC(0),
+ fTreeDTRD(0),
+ fTreeR(0),
+ fNinputs(nInputStreams),
+ fNinputsGiven(0),
+ fInputStreams(new TClonesArray("AliStream",nInputStreams)),
+ fTreeDTPCBaseName("TreeD_75x40_100x60_150x60_"),
+ fTreeTPCSBaseName("TreeS_75x40_100x60_150x60_"),
+ fCombi(new AliMergeCombi(nInputStreams,sperb)),
+ fCombination(kMaxStreamsToMerge),
+ fCombinationFileName(0),
+ fDebug(0)
+{
+ //
+ // ctor which should be used to create a manager for merging/digitization
+ //
if (nInputStreams == 0) {
Error("AliRunDigitizer","Specify nr of input streams");
return;
}
- Int_t i;
- fNinputs = nInputStreams;
- fOutputFileName = "";
- fOutputDirName = ".";
- fCombination.Set(kMaxStreamsToMerge);
- for (i=0;i<kMaxStreamsToMerge;i++) {
+ for (Int_t i=0;i<kMaxStreamsToMerge;i++) {
fArrayTreeS[i]=fArrayTreeH[i]=fArrayTreeTPCS[i]=fArrayTreeTRDS[i]=NULL;
fCombination[i]=-1;
}
- fkMASKSTEP = 10000000;
fkMASK[0] = 0;
- for (i=1;i<kMaxStreamsToMerge;i++) {
+ for (Int_t i=1;i<kMaxStreamsToMerge;i++) {
fkMASK[i] = fkMASK[i-1] + fkMASKSTEP;
}
- fInputStreams = new TClonesArray("AliStream",nInputStreams);
+
TClonesArray &lInputStreams = *fInputStreams;
// the first Input is open RW to be output as well
new(lInputStreams[0]) AliStream("UPDATE");
- for (i=1;i<nInputStreams;i++) {
+ for (Int_t i=1;i<nInputStreams;i++) {
new(lInputStreams[i]) AliStream("READ");
}
- fOutput = 0;
- fEvent = 0;
- fNrOfEventsToWrite = -1;
- fNrOfEventsWritten = 0;
- fCopyTreesFromInput = -1;
- fCombi = new AliMergeCombi(nInputStreams,sperb);
- fDebug = 0;
- fTreeD = 0;
- fTreeR = 0;
- fTreeDTPC = 0;
- fTreeDTRD = 0;
- fTreeDTPCBaseName = "TreeD_75x40_100x60_150x60_";
- fTreeTPCSBaseName = "TreeS_75x40_100x60_150x60_";
-
- for (i=0; i<kMaxStreamsToMerge; i++) fInputFiles[i]=0;
-}
-////////////////////////////////////////////////////////////////////////
+ for (Int_t i=0; i<kMaxStreamsToMerge; i++) fInputFiles[i]=0;
+}
+//_______________________________________________________________________
AliRunDigitizer::~AliRunDigitizer() {
// dtor
if (GetListOfTasks())
GetListOfTasks()->Clear("nodelete");
- if (fInputStreams) {
delete fInputStreams;
- fInputStreams = 0;
- }
- if (fCombi) {
delete fCombi;
- fCombi = 0;
- }
-
}
-////////////////////////////////////////////////////////////////////////
+
+//_______________________________________________________________________
void AliRunDigitizer::AddDigitizer(AliDigitizer *digitizer)
{
// add digitizer to the list of active digitizers
this->Add(digitizer);
}
-////////////////////////////////////////////////////////////////////////
+
+//_______________________________________________________________________
void AliRunDigitizer::SetInputStream(Int_t i, const char *inputFile)
{
if (i > fInputStreams->GetLast()) {
static_cast<AliStream*>(fInputStreams->At(i))->AddFile(inputFile);
}
-////////////////////////////////////////////////////////////////////////
+//_______________________________________________________________________
void AliRunDigitizer::Digitize(Option_t* option)
{
// get a new combination of inputs, connect input trees and loop
FinishGlobal();
}
-////////////////////////////////////////////////////////////////////////
+//_______________________________________________________________________
Bool_t AliRunDigitizer::ConnectInputTrees()
{
// fill arrays fArrayTreeS, fArrayTreeH and fArrayTreeTPCS with
return kTRUE;
}
-////////////////////////////////////////////////////////////////////////
+//_______________________________________________________________________
Bool_t AliRunDigitizer::InitGlobal()
{
// called once before Digitize() is called, initialize digitizers and output
- TList* subTasks = this->GetListOfTasks();
+ TList* subTasks = GetListOfTasks();
if (subTasks) {
subTasks->ForEach(AliDigitizer,Init)();
}
return kTRUE;
}
-////////////////////////////////////////////////////////////////////////
-
+//_______________________________________________________________________
void AliRunDigitizer::SetOutputFile(TString fn)
// the output will be to separate file, not to the signal file
{
InitOutputGlobal();
}
-////////////////////////////////////////////////////////////////////////
+//_______________________________________________________________________
Bool_t AliRunDigitizer::InitOutputGlobal()
{
// Creates the output file, called by InitEvent()
}
-////////////////////////////////////////////////////////////////////////
+//_______________________________________________________________________
void AliRunDigitizer::InitEvent()
{
// Creates TreeDxx in the output file, called from Digitize() once for
}
-////////////////////////////////////////////////////////////////////////
+//_______________________________________________________________________
void AliRunDigitizer::FinishEvent()
{
// called at the end of loop over digitizers
fTreeDTRD = 0;
}
}
-////////////////////////////////////////////////////////////////////////
+
+//_______________________________________________________________________
void AliRunDigitizer::FinishGlobal()
{
// called at the end of Exec
}
-////////////////////////////////////////////////////////////////////////
+//_______________________________________________________________________
Int_t AliRunDigitizer::GetNParticles(Int_t event) const
{
// return number of particles in all input files for a given
return sum;
}
-////////////////////////////////////////////////////////////////////////
-Int_t AliRunDigitizer::GetNParticles(Int_t event, Int_t input) const
+//_______________________________________________________________________
+Int_t AliRunDigitizer::GetNParticles(Int_t /* event */, Int_t /* input */) const
{
// return number of particles in input file input for a given
// event (as numbered in this input file)
*/
}
-////////////////////////////////////////////////////////////////////////
+//_______________________________________________________________________
Int_t* AliRunDigitizer::GetInputEventNumbers(Int_t event) const
{
// return pointer to an int array with input event numbers which were
}
return a;
}
-////////////////////////////////////////////////////////////////////////
-Int_t AliRunDigitizer::GetInputEventNumber(Int_t event, Int_t input) const
+
+//_______________________________________________________________________
+Int_t AliRunDigitizer::GetInputEventNumber(Int_t event, Int_t /* input */) const
{
// return an event number of an eventInput from input file input
// which was merged to create output event event
// simplified for now, implement later
return event;
}
-////////////////////////////////////////////////////////////////////////
+
+//_______________________________________________________________________
TParticle* AliRunDigitizer::GetParticle(Int_t i, Int_t event) const
{
// return pointer to particle with index i (index with mask)
return GetParticle(i,input,GetInputEventNumber(event,input));
}
-////////////////////////////////////////////////////////////////////////
-TParticle* AliRunDigitizer::GetParticle(Int_t i, Int_t input, Int_t event) const
+//_______________________________________________________________________
+TParticle* AliRunDigitizer::GetParticle(Int_t /* i */, Int_t /* input */,
+ Int_t /* event */) const
{
// return pointer to particle with index i in the input file input
// (index without mask)
*/
}
-////////////////////////////////////////////////////////////////////////
+//_______________________________________________________________________
void AliRunDigitizer::ExecuteTask(Option_t* option)
{
// overwrite ExecuteTask to do Digitize only
fHasExecuted = kTRUE;
return;
}
-////////////////////////////////////////////////////////////////////////
+
+//_______________________________________________________________________
TString AliRunDigitizer::GetInputFileName(const Int_t input, const Int_t order) const
{
// returns file name of the order-th file in the input stream input
fileName = stream->GetFileName(order);
return fileName;
}
-////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
// --- ROOT system ---
-#include "TNamed.h"
-#include "TObjString.h"
+
#include "TArrayI.h"
-#include "TClonesArray.h"
-#include "TTree.h"
-#include "TParticle.h"
#include "TTask.h"
-
-const Int_t kMaxStreamsToMerge = 4;
+class TClonesArray;
+class TFile;
+class TParticle;
+class TTree;
// --- AliRoot header files ---
class AliDigitizer;
class AliMergeCombi;
+const Int_t kMaxStreamsToMerge = 4;
+
class AliRunDigitizer: public TTask {
public:
AliRunDigitizer();
AliRunDigitizer(Int_t nInputStreams, Int_t sperb=1);
+ AliRunDigitizer(const AliRunDigitizer& dig);
+ AliRunDigitizer& operator=(const AliRunDigitizer& dig)
+ {dig.Copy(*this); return (*this);}
virtual ~AliRunDigitizer();
void AddDigitizer(AliDigitizer *digitizer);
void SetOutputFile(TString fn);
void SetDebug(Int_t level) {fDebug = level;}
private:
+ void Copy(AliRunDigitizer& dig) const;
+ Bool_t ConnectInputTrees();
+ Bool_t InitGlobal();
+ Bool_t InitOutputGlobal();
+ void InitEvent();
+ void FinishEvent();
+ void FinishGlobal();
+
Int_t fkMASK[kMaxStreamsToMerge]; //! masks for track ids from
// different source files
Int_t fkMASKSTEP; // step to increase MASK for
TArrayI fCombination; //! combination of events from
TString fCombinationFileName; // fn with combinations (used
// with type 2 of comb.)
- Bool_t ConnectInputTrees();
- Bool_t InitGlobal();
- Bool_t InitOutputGlobal();
- void InitEvent();
- void FinishEvent();
- void FinishGlobal();
Int_t fDebug; //! specifies debug level, 0 is min
ClassDef(AliRunDigitizer,4)
// Test points for auto calibration
virtual void GiveTestPoints(Int_t &n, Float_t *x, Float_t *y) const = 0;
// Draw the segmentation zones
- virtual void Draw(const char *opt = "") const = 0;
+ virtual void Draw(const char *opt = "") const = 0;
// Function for systematic corrections
// Set the correction function
virtual void SetCorrFunc(Int_t, TF1*) = 0;
/*
$Log$
+Revision 1.25 2002/10/22 15:21:39 hristov
+New methods for more effective access of particles from TreeK (J.Chudoba)
+
Revision 1.24 2002/10/22 15:02:15 alibrary
Introducing Riostream.h
ClassImp(AliStack)
-//_____________________________________________________________________________
-AliStack::AliStack(Int_t size)
- : TVirtualMCStack()
+//_______________________________________________________________________
+AliStack::AliStack():
+ fParticles(0),
+ fParticleMap(0),
+ fParticleFileMap(0),
+ fParticleBuffer(0),
+ fTreeK(0),
+ fNtrack(0),
+ fNprimary(0),
+ fCurrent(-1),
+ fCurrentPrimary(-1),
+ fHgwmk(0),
+ fLoadPoint(0)
{
//
- // Constructor
+ // Default constructor
//
-
- // Create the particles arrays
- fParticles = new TClonesArray("TParticle",1000);
- fParticleMap = new TObjArray(size);
- fParticleBuffer = 0;
- fNtrack = 0;
- fNprimary = 0;
- fCurrent = -1;
- fCurrentPrimary = -1;
- fTreeK = 0;
}
+//_______________________________________________________________________
+AliStack::AliStack(Int_t size):
+ fParticles(new TClonesArray("TParticle",1000)),
+ fParticleMap(new TObjArray(size)),
+ fParticleFileMap(0),
+ fParticleBuffer(0),
+ fTreeK(0),
+ fNtrack(0),
+ fNprimary(0),
+ fCurrent(-1),
+ fCurrentPrimary(-1),
+ fHgwmk(0),
+ fLoadPoint(0)
+{
+ //
+ // Constructor
+ //
+}
-//_____________________________________________________________________________
-AliStack::AliStack()
- : TVirtualMCStack()
+//_______________________________________________________________________
+AliStack::AliStack(const AliStack& st):
+ TVirtualMCStack(st),
+ fParticles(0),
+ fParticleMap(0),
+ fParticleFileMap(0),
+ fParticleBuffer(0),
+ fTreeK(0),
+ fNtrack(0),
+ fNprimary(0),
+ fCurrent(-1),
+ fCurrentPrimary(-1),
+ fHgwmk(0),
+ fLoadPoint(0)
{
//
- // Default constructor
+ // Copy constructor
//
-
- // Create the particles arrays
- fParticles = 0;
- fParticleMap = 0;
- fParticleBuffer = 0;
- fNtrack = 0;
- fCurrent = -1;
- fNprimary = 0;
- fCurrentPrimary = -1;
- fTreeK = 0;
+ st.Copy(*this);
}
+//_______________________________________________________________________
+void AliStack::Copy(AliStack&) const
+{
+ Fatal("Copy","Not implemented!\n");
+}
-//_____________________________________________________________________________
+//_______________________________________________________________________
AliStack::~AliStack()
{
//
delete fParticles;
}
delete fParticleMap;
- if (fTreeK) delete fTreeK;
+ delete fTreeK;
}
//
fParticleMap->AddAtAndExpand(particle, fNtrack);//CHECK!!
if(parent>=0) {
- particle = (TParticle*) fParticleMap->At(parent);
+ particle = dynamic_cast<TParticle*>(fParticleMap->At(parent));
if (particle) {
particle->SetLastDaughter(fNtrack);
if(particle->GetFirstDaughter()<0) particle->SetFirstDaughter(fNtrack);
if(i<=fHgwmk) map[i]=i ;
else {
map[i] = -99;
- if((part=(TParticle*) particles.At(i))) {
+ if((part=dynamic_cast<TParticle*>(particles.At(i)))) {
//
// Check of this track should be kept for physics reasons
if (KeepPhysics(part)) KeepTrack(i);
// 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);
+ part = dynamic_cast<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++) {
map[i]=nkeep;
// If old and new are different, have to move the pointer
if(i!=nkeep) particles[nkeep]=particles.At(i);
- part = (TParticle*) particles.At(nkeep);
+ part = dynamic_cast<TParticle*>(particles.At(nkeep));
// as the parent is always *before*, it must be already
// in place. This is what we are checking anyway!
// Fix daughters information
for (i=fHgwmk+1; i<nkeep; i++) {
- part = (TParticle *)particles.At(i);
+ part = dynamic_cast<TParticle*>(particles.At(i));
parent = part->GetFirstMother();
if(parent>=0) {
- father = (TParticle *)particles.At(parent);
+ father = dynamic_cast<TParticle*>(particles.At(parent));
if(father->TestBit(kDaughtersBit)) {
if(i<father->GetFirstDaughter()) father->SetFirstDaughter(i);
TList* hitLists = gAlice->GetHitLists();
TIter next(hitLists);
TCollection *hitList;
- while((hitList = (TCollection*)next())) {
+ while((hitList = dynamic_cast<TCollection*>(next()))) {
TIter nexthit(hitList);
AliHit *hit;
- while((hit = (AliHit*)nexthit())) {
+ while((hit = dynamic_cast<AliHit*>(nexthit()))) {
hit->SetTrack(map[hit->GetTrack()]);
}
}
TObjArray* modules = gAlice->Modules();
TIter nextmod(modules);
AliModule *detector;
- while((detector = (AliModule*)nextmod())) {
+ while((detector = dynamic_cast<AliModule*>(nextmod()))) {
detector->RemapTrackHitIDs(map.GetArray());
detector->RemapTrackReferencesIDs(map.GetArray());
}
if(nkeep>fParticleFileMap.GetSize()) fParticleFileMap.Set(Int_t (nkeep*1.5));
for (i=fHgwmk+1; i<nkeep; ++i) {
- fParticleBuffer = (TParticle*) particles.At(i);
- fParticleFileMap[i]=(Int_t) fTreeK->GetEntries();
+ fParticleBuffer = dynamic_cast<TParticle*>(particles.At(i));
+ fParticleFileMap[i]=static_cast<Int_t>(fTreeK->GetEntries());
fTreeK->Fill();
particles[i]=fParticleBuffer=0;
}
//
Int_t parent = part->GetFirstMother();
if (parent >= 0 && parent <= fHgwmk) {
- TParticle* father = (TParticle*) Particles()->At(parent);
+ TParticle* father = dynamic_cast<TParticle*>(Particles()->At(parent));
Int_t kf = father->GetPdgCode();
kf = TMath::Abs(kf);
Int_t kfl = kf;
TObject *part;
for(Int_t i=0; i<fHgwmk+1; ++i)
if((part=fParticleMap->At(i))) {
- fParticleBuffer = (TParticle*) part;
- fParticleFileMap[i]= (Int_t) fTreeK->GetEntries();
+ fParticleBuffer = dynamic_cast<TParticle*>(part);
+ fParticleFileMap[i]= static_cast<Int_t>(fTreeK->GetEntries());
fTreeK->Fill();
//PH (*fParticleMap)[i]=fParticleBuffer=0;
fParticleBuffer=0;
Int_t curr=track;
while(1) {
- particle=(TParticle*)fParticleMap->At(curr);
+ particle=dynamic_cast<TParticle*>(fParticleMap->At(curr));
// If the particle is flagged the three from here upward is saved already
if(particle->TestBit(kKeepBit)) return;
}
//_____________________________________________________________________________
-void AliStack::SetHighWaterMark(Int_t nt)
+void AliStack::SetHighWaterMark(Int_t)
{
//
// Set high water mark for last track in event
new ((*fParticles)[nentries]) TParticle(*fParticleBuffer);
fParticleMap->AddAt((*fParticles)[nentries],i);
}
- //PH return (TParticle *) (*fParticleMap)[i];
- return (TParticle *) fParticleMap->At(i);
+ //PH return dynamic_cast<TParticle *>((*fParticleMap)[i]);
+ return dynamic_cast<TParticle*>(fParticleMap->At(i));
}
//_____________________________________________________________________________
// Dumps particle i in the stack
//
- //PH ((TParticle*) (*fParticleMap)[i])->Print();
- ((TParticle*) fParticleMap->At(i))->Print();
+ //PH dynamic_cast<TParticle*>((*fParticleMap)[i])->Print();
+ dynamic_cast<TParticle*>(fParticleMap->At(i))->Print();
}
//_____________________________________________________________________________
"\n\n=======================================================================\n");
for (Int_t i=0;i<fNtrack;i++)
{
- TParticle* particle = (TParticle*) particles[i];
+ TParticle* particle = dynamic_cast<TParticle*>(particles[i]);
if (particle) {
printf("-> %d ",i); particle->Print();
printf("--------------------------------------------------------------\n");
TParticle *part;
int i;
for(i=0; i<fHgwmk+1; i++) {
- part = (TParticle *)particles.At(i);
+ part = dynamic_cast<TParticle*>(particles.At(i));
if(part) if(!part->TestBit(kDaughtersBit)) {
part->SetFirstDaughter(-1);
part->SetLastDaughter(-1);
// search secondaries
//for(Int_t i=fNtrack-1; i>=0; i--) {
for(Int_t i=fNtrack-1; i>fHgwmk; i--) {
- particle = (TParticle*) fParticleMap->At(i);
+ particle = dynamic_cast<TParticle*>(fParticleMap->At(i));
if ((particle) && (!particle->TestBit(kDoneBit))) {
fCurrent=i;
//cout << "GetNextParticle() - secondary "
// take next primary if all secondaries were done
while (fCurrentPrimary>=0) {
fCurrent = fCurrentPrimary;
- particle = (TParticle*) fParticleMap->At(fCurrentPrimary--);
+ particle = dynamic_cast<TParticle*>(fParticleMap->At(fCurrentPrimary--));
if ((particle) && (!particle->TestBit(kDoneBit))) {
//cout << "GetNextParticle() - primary "
// << fNtrack << " " << fHgwmk << " " << fCurrent << endl;
}
//__________________________________________________________________________________________
-void AliStack::MakeTree(Int_t event, const char *file)
+void AliStack::MakeTree(Int_t event, const char * /*file*/)
{
//
// Make Kine tree and creates branch for writing particles
// Get Kine Tree from file
char treeName[20];
sprintf(treeName,"TreeK%d",event);
- fTreeK = (TTree*)gDirectory->Get(treeName);
+ fTreeK = dynamic_cast<TTree*>(gDirectory->Get(treeName));
if (fTreeK)
fTreeK->SetBranchAddress("Particles", &fParticleBuffer);
// printf("\n primaries %d", fNprimary);
// printf("\n tracks %d", fNtrack);
- Int_t size = (Int_t)fTreeK->GetEntries();
+ Int_t size = static_cast<Int_t>(fTreeK->GetEntries());
ResetArrays(size);
return kTRUE;
}
/* $Id$ */
-#include <TObject.h>
#include <TArrayI.h>
+#include <TMCProcess.h>
+#include <TObject.h>
#include <TStopwatch.h>
#include <TVirtualMCStack.h>
-#include <TMCProcess.h>
-class TObjArray;
-class TClonesArray;
-class TParticle;
class AliHeader;
+class TClonesArray;
class TFile;
+class TObjArray;
+class TParticle;
class TTree;
-
-
class AliStack : public TVirtualMCStack
{
public:
// creators, destructors
AliStack(Int_t size);
AliStack();
+ AliStack(const AliStack& st);
virtual ~AliStack();
+ AliStack& operator=(const AliStack& st)
+ {st.Copy(*this); return(*this);}
// methods
virtual void SetTrack(Int_t done, Int_t parent, Int_t pdg,
Bool_t KeepPhysics(TParticle* part);
private:
+ void Copy(AliStack &st) const;
+
// data members
TClonesArray *fParticles; //! Pointer to list of particles
TObjArray *fParticleMap; //! Map of particles in the supporting TClonesArray
/*
$Log$
+Revision 1.8 2002/10/22 15:02:15 alibrary
+Introducing Riostream.h
+
Revision 1.7 2002/10/14 14:57:33 hristov
Merging the VirtualMC branch to the main development branch (HEAD)
#include <Riostream.h>
-#include "TTree.h"
+#include "TFile.h"
+#include "TObjString.h"
#include "TROOT.h"
-
-#include "AliStream.h"
+#include "TTree.h"
#include "AliRun.h"
+#include "AliStream.h"
ClassImp(AliStream)
-AliStream::AliStream()
+//_______________________________________________________________________
+AliStream::AliStream():
+ fLastEventSerialNr(0),
+ fLastEventNr(0),
+ fCurrentFileIndex(0),
+ fEvents(0),
+ fMode(0),
+ fCurrentFile(0),
+ fFileNames(0)
{
-// root requires default ctor, where no new objects can be created
-// do not use this ctor, it is supplied only for root needs
- fCurrentFile = 0;
- fEvents = 0;
- fFileNames = 0;
+ //
+ // root requires default ctor, where no new objects can be created
+ // do not use this ctor, it is supplied only for root needs
+ //
}
-////////////////////////////////////////////////////////////////////////
-AliStream::AliStream(Option_t *option)
+//_______________________________________________________________________
+AliStream::AliStream(Option_t *option):
+ fLastEventSerialNr(-1),
+ fLastEventNr(0),
+ fCurrentFileIndex(-1),
+ fEvents(0),
+ fMode(option),
+ fCurrentFile(0),
+ fFileNames(new TObjArray(1))
{
-// ctor
- fLastEventSerialNr = -1;
- fLastEventNr = 0;
- fCurrentFileIndex = -1;
- fCurrentFile = 0;
- fEvents = 0;
- fFileNames = new TObjArray(1);
- fMode = option;
+ //
+ // Default ctor
+ //
}
-////////////////////////////////////////////////////////////////////////
+//_______________________________________________________________________
+AliStream::AliStream(const AliStream& str):
+ TNamed(str),
+ fLastEventSerialNr(0),
+ fLastEventNr(0),
+ fCurrentFileIndex(0),
+ fEvents(0),
+ fMode(0),
+ fCurrentFile(0),
+ fFileNames(0)
+{
+ //
+ // Copy ctor
+ //
+ str.Copy(*this);
+}
+
+//_______________________________________________________________________
+void AliStream::Copy(AliStream& ) const
+{
+ Fatal("Copy","Not implemented\n");
+}
+
+//_______________________________________________________________________
AliStream::~AliStream()
{
// default dtor
}
}
-////////////////////////////////////////////////////////////////////////
+//_______________________________________________________________________
void AliStream::AddFile(const char *fileName)
{
// stores the name of the file
fFileNames->Add(name);
}
-////////////////////////////////////////////////////////////////////////
+//_______________________________________________________________________
Bool_t AliStream::NextEventInStream(Int_t &serialNr)
{
// returns kFALSE if no more events
return kTRUE;
}
-////////////////////////////////////////////////////////////////////////
+//_______________________________________________________________________
void AliStream::ChangeMode(Option_t* option)
// set the mode to READ or UPDATE, reopen file with the new mode
// only change from UPDATE to READ have sense in the current scheme,
}
}
-////////////////////////////////////////////////////////////////////////
+//_______________________________________________________________________
Bool_t AliStream::OpenNextFile()
{
if (++fCurrentFileIndex > fFileNames->GetLast()) {
static_cast<TObjString*>(fFileNames->At(fCurrentFileIndex))->GetName();
// check if the file was already opened by some other code
- TFile *f = (TFile *)(gROOT->GetListOfFiles()->FindObject(filename));
+ TFile *f = dynamic_cast<TFile*>(gROOT->GetListOfFiles()->FindObject(filename));
if (f) f->Close();
if (fCurrentFile) {
return kFALSE;
}
// find nr of events in the given file
- TTree * te = (TTree *) fCurrentFile->Get("TE") ;
+ TTree * te = dynamic_cast<TTree *>(fCurrentFile->Get("TE"));
if (!te) {
Error("OpenNextFile", "input file does not contain TE");
return kFALSE;
return kTRUE;
}
-////////////////////////////////////////////////////////////////////////
+//_______________________________________________________________________
Bool_t AliStream::ImportgAlice()
{
if (fFileNames->GetLast() < 0) return kFALSE;
if (!fCurrentFile) {
if (!OpenNextFile()) return kFALSE;
}
- gAlice = (AliRun*)fCurrentFile->Get("gAlice");
+ gAlice = dynamic_cast<AliRun*>(fCurrentFile->Get("gAlice"));
if (!gAlice) return kFALSE;
return kTRUE;
}
-////////////////////////////////////////////////////////////////////////
+
+//_______________________________________________________________________
TString AliStream::GetFileName(const Int_t order) const
// returns name of the order-th file
// returns empty string if such file does not exist
if (fileNameStored) fileName = fileNameStored->GetString();
return fileName;
}
-////////////////////////////////////////////////////////////////////////
+
// --- ROOT system ---
#include "TNamed.h"
-#include "TObjString.h"
#include "TString.h"
-#include "TArrayI.h"
-#include "TClonesArray.h"
-#include "TFile.h"
+
+class TFile;
+class TObjArray;
// --- AliRoot header files ---
public:
AliStream();
AliStream(Option_t *option);
+ AliStream(const AliStream&);
+ AliStream & operator=(const AliStream& str)
+ {str.Copy(*this); return (*this);}
virtual ~AliStream();
void AddFile(const char *fileName);
Bool_t NextEventInStream(Int_t &eventNr);
TString GetFileName(const Int_t order) const;
private:
+ void Copy(AliStream& str) const;
+
Int_t fLastEventSerialNr;
Int_t fLastEventNr;
Int_t fCurrentFileIndex;
/*
$Log$
+Revision 1.3 2002/10/22 15:02:15 alibrary
+Introducing Riostream.h
+
Revision 1.2 2002/10/14 14:57:33 hristov
Merging the VirtualMC branch to the main development branch (HEAD)
ClassImp(AliTrackMap)
-////////////////////////////////////////////////////////////////////////
-AliTrackMap::AliTrackMap()
+//_______________________________________________________________________
+AliTrackMap::AliTrackMap():
+ fSize(0),
+ fArray(0)
{
-//
-// default ctor
-//
- fArray=0;
- fSize = 0;
+ //
+ // default ctor
+ //
}
-////////////////////////////////////////////////////////////////////////
-AliTrackMap::AliTrackMap(Int_t size, Int_t *array) :
- TNamed("AliTrackMap", "AliTrackMap")
+
+//_______________________________________________________________________
+AliTrackMap::AliTrackMap(const AliTrackMap& trm):
+ TNamed(trm),
+ fSize(0),
+ fArray(0)
{
-//
-// ctor
-//
+ //
+ // default ctor
+ //
+ trm.Copy(*this);
+}
- fSize = size;
- fArray = new Int_t[fSize];
+//_______________________________________________________________________
+AliTrackMap::AliTrackMap(Int_t size, Int_t *array):
+ TNamed("AliTrackMap", "AliTrackMap"),
+ fSize(size),
+ fArray(new Int_t[fSize])
+{
+ //
+ // ctor
+ //
for (Int_t i = 0; i < fSize; i++) fArray[i] = array[i];
}
-////////////////////////////////////////////////////////////////////////
-AliTrackMap::~AliTrackMap()
+
+//_______________________________________________________________________
+void AliTrackMap::Copy(AliTrackMap& ) const
{
-//
-// dtor
-//
+ Fatal("Copy","Not implemented\n");
+}
+//_______________________________________________________________________
+AliTrackMap::~AliTrackMap()
+{
+ //
+ // dtor
+ //
delete [] fArray;
}
-////////////////////////////////////////////////////////////////////////
-Int_t AliTrackMap::At(Int_t label)
+//_______________________________________________________________________
+Int_t AliTrackMap::At(Int_t label) const
{
-//
-// returns entry number in the TreeH corresponding to particle with
-// label label
-//
+ //
+ // returns entry number in the TreeH corresponding to particle with
+ // label label
+ //
if (label < 0 || label >= fSize) {
cerr<<"AliTrackMap::At: label "<<label<<" out of range, fSize = "<<fSize<<endl;
return kOutOfBounds;
}
return fArray[label];
}
-////////////////////////////////////////////////////////////////////////
+
+//_______________________________________________________________________
void AliTrackMap::SetEventNr(Int_t eventNr)
{
-//
-// map is identified by it's name, event number is part of it
-//
+ //
+ // map is identified by it's name, event number is part of it
+ //
char name[20];
sprintf(name,"AliTrackMap_%5.5d",eventNr);
SetName(name);
}
-////////////////////////////////////////////////////////////////////////
-void AliTrackMap::PrintValues()
+
+//_______________________________________________________________________
+void AliTrackMap::PrintValues() const
{
-//
-// method for debugging
-//
+ //
+ // method for debugging
+ //
cout<<this->GetName()<<" contains these values: "<<endl;
for (Int_t i = 0; i < fSize; i++) {
cout<<i<<"\t"<<fArray[i]<<"\n";
}
}
-////////////////////////////////////////////////////////////////////////
+
public:
AliTrackMap();
AliTrackMap(Int_t size, Int_t *array);
+ AliTrackMap(const AliTrackMap& trm);
+ AliTrackMap& operator=(const AliTrackMap& trm)
+ {trm.Copy(*this); return(*this);}
~AliTrackMap();
- Int_t At(Int_t label);
- Int_t Size(){return fSize;}
+ Int_t At(Int_t label) const;
+ Int_t Size() const {return fSize;}
void SetEventNr(Int_t eventNr);
- void PrintValues();
+ void PrintValues() const;
private:
- Int_t fSize; // size of the array
+ void Copy(AliTrackMap &trm) const;
+ Int_t fSize; // size of the array
Int_t *fArray; //[fSize] actual map
ClassDef(AliTrackMap,1) // connection between track label and TreeH indeces
/*
$Log$
+Revision 1.4 2002/10/22 15:02:15 alibrary
+Introducing Riostream.h
+
Revision 1.3 2002/10/14 14:57:33 hristov
Merging the VirtualMC branch to the main development branch (HEAD)
ClassImp(AliTrackMapper)
-////////////////////////////////////////////////////////////////////////
+//_______________________________________________________________________
+AliTrackMapper::AliTrackMapper():
+ fDEBUG(0)
+{
+ //
+ // Default ctor
+ //
+}
+
+
+//_______________________________________________________________________
void AliTrackMapper::CreateMap(Int_t nEvents, Int_t firstEventNr,
- const char* fnMap, const char* fnHits)
+ const char* fnMap, const char* fnHits)
{
-//
-// method to create a track map for a given number of events starting
-// from event firstEventNr. This method just opens and closes files and
-// loops over events, the creation of map is delegated to
-// CreateMap(Int_t eventNr, TFile* fileMap) method
-//
+ //
+ // method to create a track map for a given number of events starting
+ // from event firstEventNr. This method just opens and closes files and
+ // loops over events, the creation of map is delegated to
+ // CreateMap(Int_t eventNr, TFile* fileMap) method
+ //
TStopwatch timer;
timer.Start();
TFile *fileMap=TFile::Open(fnMap,"new");
if (!fileMap->IsOpen()) {cerr<<"Can't open output file "<<fnMap<<"!\n"; return;}
-
+
TFile *fileHits=TFile::Open(fnHits);
if (!fileHits->IsOpen()) {cerr<<"Can't open input file "<<fnHits<<"!\n"; return;}
- if (!(gAlice=(AliRun*)fileHits->Get("gAlice"))) {
+ if (!(gAlice=dynamic_cast<AliRun*>(fileHits->Get("gAlice")))) {
cerr<<"gAlice have not been found on galice.root !\n";
return;
}
-
+
for (Int_t eventNr = firstEventNr; eventNr < firstEventNr+nEvents;
eventNr++) {
CreateMap(eventNr,fileMap);
} // end loop over events
-
+
delete gAlice;
gAlice = 0;
fileHits->Close();
if (fDEBUG > 0) timer.Print();
}
-////////////////////////////////////////////////////////////////////////
-Int_t AliTrackMapper::CreateMap(Int_t eventNr, TFile* fileMap) {
-//
-// create an AliTrackMap for a given event
-// correct gAlice must be already present in memory
-//
-
+//_______________________________________________________________________
+Int_t AliTrackMapper::CreateMap(Int_t eventNr, TFile* fileMap)
+{
+ //
+ // create an AliTrackMap for a given event
+ // correct gAlice must be already present in memory
+ //
Int_t nGenPrimPlusSecParticles = gAlice->GetEvent(eventNr);
if (fDEBUG > 1) cout<<"nGenPrimPlusSecParticles = "<<nGenPrimPlusSecParticles<<endl;
if (nGenPrimPlusSecParticles < 1) {
Int_t treeHEntries = static_cast<Int_t>(treeH->GetEntries());
if (fDEBUG > 1) cout<<"treeHEntries "<<treeHEntries<<endl;
-
TObjArray *modules = gAlice->Detectors();
if (!modules) {
cerr<<"TObjArray with modules not found."<<endl;
for (Int_t iModule = 0; iModule < nModules; iModule++) {
AliDetector * detector = dynamic_cast<AliDetector*>(modules->At(iModule));
if (!detector) continue;
-// process only detectors with shunt = 0
+ // process only detectors with shunt = 0
if (detector->GetIshunt()) continue;
- hit=(AliHit*)detector->FirstHit(-1);
+ hit=dynamic_cast<AliHit*>(detector->FirstHit(-1));
Int_t lastLabel=-1, label;
- for( ; hit; hit=(AliHit*)detector->NextHit() ) {
+ for( ; hit; hit=dynamic_cast<AliHit*>(detector->NextHit()) ) {
label=hit->Track();
if (lastLabel != label) {
if (label < 0 || label >= nAllParticles) {
return 0;
}
-////////////////////////////////////////////////////////////////////////
+//_______________________________________________________________________
AliTrackMap* AliTrackMapper::LoadTrackMap(Int_t eventNr, const char* fnMap, TFile* &fileMap) {
-//
-// read an AliTrackMap object for the given event eventNr from
-// the file fileMap
-//
+ //
+ // read an AliTrackMap object for the given event eventNr from
+ // the file fileMap
+ //
fileMap=TFile::Open(fnMap);
if (!fileMap->IsOpen()) {cerr<<"Can't open file "<<fnMap<<" with map!\n"; return 0;}
char mapName[20];
sprintf(mapName,"AliTrackMap_%5.5d",eventNr);
- AliTrackMap* trackMapObject = (AliTrackMap*)fileMap->Get(mapName);
+ AliTrackMap* trackMapObject = dynamic_cast<AliTrackMap*>(fileMap->Get(mapName));
if (!trackMapObject) {
cerr<<"Error: map named "<<mapName<<" not found."<<endl;
return 0;
}
return trackMapObject;
}
-////////////////////////////////////////////////////////////////////////
+
+//_______________________________________________________________________
void AliTrackMapper::CheckTrackMap(Int_t eventNr, const char* fnMap) {
-//
-//
-//
+ //
+ //
+ //
TFile *fileMap;
AliTrackMap* trackMapObject = LoadTrackMap(eventNr, fnMap, fileMap);
if (!trackMapObject) return;
-
+
trackMapObject->PrintValues();
-
+
delete trackMapObject;
fileMap->Close();
delete fileMap;
}
-////////////////////////////////////////////////////////////////////////
class AliTrackMapper {
public:
- AliTrackMapper(){fDEBUG=0;}
- virtual ~AliTrackMapper(){;}
+ AliTrackMapper();
+ virtual ~AliTrackMapper(){}
void CreateMap(Int_t nEvents, Int_t firstEventNr,
const char* fnMap = "trackMap.root",
const char* fnHits ="rfio:galice.root");
ClassImp(AliTrackReference)
-AliTrackReference::AliTrackReference()
+//_______________________________________________________________________
+ AliTrackReference::AliTrackReference():
+ fTrack(0),
+ fX(0),
+ fY(0),
+ fZ(0),
+ fPx(0),
+ fPy(0),
+ fPz(0),
+ fLength(0)
{
//
// Default constructor
//
- fTrack = 0;
- fX = fY = fZ = fPx = fPy = fPz = fLength = 0.;
}