* provided "as is" without express or implied warranty. *
**************************************************************************/
-/*
-$Log$
-Revision 1.1 2000/11/01 16:01:22 kowal2
-Classes for handling the new hits structures
+/* $Id$ */
-*/
#include "TROOT.h"
#include "AliArrayBranch.h"
#include "TFile.h"
-Int_t AliArraySubBranch::GetEntryExport(Int_t entry, Int_t getall, AliObjectArray *list, Int_t nentries)
+ Int_t AliArraySubBranch::GetEntryExport(Int_t entry, Int_t /*getall*/, AliObjectArray *list, Int_t nentries)
{
//*-*-*-*-*-*Read all leaves of entry and return total number of bytes*-*-*
//*-* export buffers to real objects in the AliObjectArray list.
* provided "as is" without express or implied warranty. *
**************************************************************************/
-/*
-$Log$
-Revision 1.1 2000/11/01 15:57:13 kowal2
-Moved from the TPC directory
-
-Revision 1.2 2000/04/17 09:37:33 kowal2
-removed obsolete AliTPCDigitsDisplay.C
-
-Revision 1.1.4.2 2000/04/10 11:32:37 kowal2
-
-"ROOT"-based class with some extra functionality
-
-*/
+/* $Id$ */
///////////////////////////////////////////////////////////////////////
// Added additional functionality to original TArrayI //
* provided "as is" without express or implied warranty. *
**************************************************************************/
-/*
-$Log$
-Revision 1.1 2000/11/01 15:57:13 kowal2
-Moved from the TPC directory
-
-Revision 1.2 2000/04/17 09:37:33 kowal2
-removed obsolete AliTPCDigitsDisplay.C
-
-Revision 1.1.4.2 2000/04/10 11:32:37 kowal2
-
-"ROOT"-based class with some extra functionality
-
-*/
+/* $Id$ */
///////////////////////////////////////////////////////////////////////
// Added additional functionality to original TArrayS //
* provided "as is" without express or implied warranty. *
**************************************************************************/
-/*
-$Log$
-*/
+/* $Id$ */
+
///////////////////////////////////////////////////////////////////////////////
// //
// AliArrayVT //
* provided "as is" without express or implied warranty. *
**************************************************************************/
-/*
-$Log$
-Revision 1.2 2000/11/10 15:54:51 kowal2
-Corrections by P.Hristov to deal with the CINT problems.
+/* $Id$ */
-Revision 1.1 2000/11/01 16:01:22 kowal2
-Classes for handling the new hits structures
-
-*/
///////////////////////////////////////////////////////////////////////////////
// //
// AliClassInfo //
public:
AliClassInfo(){;}
virtual ~AliClassInfo(){;}
- virtual void CTORBuffer(void * pointer, UInt_t size=1){;}
+ virtual void CTORBuffer(void * /*pointer*/, UInt_t /*size=1*/){;}
// {return (*ctorbuffer)(p,size);}
- virtual void DTORBuffer(void * pointer, UInt_t size=1){;}
+ virtual void DTORBuffer(void * /*pointer*/, UInt_t /*size=1*/){;}
//{return (*dtorbuffer)(p,size);}
- virtual void StreamBuffer(TBuffer& b, const void *object, UInt_t size){;}
+ virtual void StreamBuffer(TBuffer& /*b*/,
+ const void */*object*/, UInt_t /*size*/){;}
//{return (*streamb)(b,object,size);}
- virtual void ObjectDump(void *p){;}
+ virtual void ObjectDump(void */*p*/){;}
virtual const char * GetClassName(){ return 0;}
virtual TClass * GetClass(){return 0;}
virtual TDataType * GetDataType(){return 0;}
* provided "as is" without express or implied warranty. *
**************************************************************************/
-/*
-$Log$
-Revision 1.2 2002/02/04 14:47:22 hristov
-Corrections needed bu Root v3-02-07
+/* $Id$ */
-Revision 1.1 2000/11/01 16:01:22 kowal2
-Classes for handling the new hits structures
-
-*/
///////////////////////////////////////////////////////////////////////////////
// //
// AliDataType //
void ObjectDump(void *p);
TDataType * GetDataType(){return fDataType;}
protected:
- AliDataType(const AliDataType & type){;}
+ AliDataType(const AliDataType & type): AliClassInfo(type) {;}
AliDataType &operator = (const AliDataType & type){return *this;} //assignment operator
TDataType * fDataType; //root type information
ClassDef(AliDataType,0)
* provided "as is" without express or implied warranty. *
**************************************************************************/
-/*
-
-$Log$
-Revision 1.4 2002/01/21 17:04:12 kowal2
-check the range of digits array
-
-Revision 1.3 2001/11/24 16:08:09 kowal2
-Fatsre algorithms
-
-Revision 1.2 2000/12/20 09:36:46 kowal2
-Improvements in algorithms to make the code faster
-
-Revision 1.1 2000/11/01 15:57:13 kowal2
-Moved from the TPC directory
-
-Revision 1.4 2000/10/05 16:01:49 kowal2
-Corrected for memory leaks.
-
-Revision 1.3 2000/06/30 12:07:49 kowal2
-Updated from the TPC-PreRelease branch
-
-Revision 1.2.4.3 2000/06/26 07:39:42 kowal2
-Changes to obey the coding rules
-
-Revision 1.2.4.2 2000/06/25 08:38:41 kowal2
-Splitted from AliTPCtracking
-
-Revision 1.2.4.1 2000/06/14 16:45:13 kowal2
-Improved algorithms. Compiler warnings removed.
-
-Revision 1.2 2000/04/17 09:37:33 kowal2
-removed obsolete AliTPCDigitsDisplay.C
-
-Revision 1.1.4.2 2000/04/10 11:37:42 kowal2
-
-Digits handling in a new data structure
-
-*/
+/* $Id$ */
/*MI change -- for Rule checker
-- added copy constructor and assignmet operator
Invalidate();
}
-AliDigits::AliDigits(const AliDigits& digits)
+AliDigits::AliDigits(const AliDigits& digits):
+ AliSegmentID(digits)
{
//
//copy constructor
#include "AliH2F.h"
#include "TClonesArray.h"
-#include "AliTPC.h"
#include "TRandom.h"
//
}
-AliH2F::AliH2F(const AliH2F &his)
+AliH2F::AliH2F(const AliH2F &his) :
+ TH2F(his)
{
//
}
-AliH2F & AliH2F::operator = (const AliH2F & his)
+AliH2F & AliH2F::operator = (const AliH2F & /*his*/)
{
//
return *this;
}
+/*
TClonesArray * AliH2F::FindPeaks(Float_t threshold, Float_t noise)
{
-
- //
- // not implemented
- //
- return 0;
+ //find peaks and write it in form of AliTPCcluster to array
+
+ //firstly we need to create object for cluster finding
+ //and fill it with contents of histogram
+ AliTPCClusterFinder cfinder;
+ cfinder.SetThreshold(threshold);
+ cfinder.SetNoise(noise);
+ cfinder.GetHisto(this);
+ return cfinder.FindPeaks3();
}
+*/
void AliH2F::ClearSpectrum()
{
public:
AliH2F(const AliH2F &his);
AliH2F & operator = (const AliH2F &his);
- TClonesArray * FindPeaks(Float_t threshold, Float_t noise);
+// TClonesArray * FindPeaks(Float_t threshold, Float_t noise);
//find peaks and write it in form of AliTPCcluster to array
void ClearSpectrum();
void AddGauss(Float_t x,Float_t y,Float_t sx, Float_t sy, Float_t max);
* provided "as is" without express or implied warranty. *
**************************************************************************/
-/*
-$Log$
-Revision 1.2 2001/01/10 09:33:56 kowal2
-Clear method modified to fix the problem with reading Tree.
+/* $Id$ */
-Revision 1.1 2000/11/01 16:01:26 kowal2
-Classes for handling the new hits structures
-
-*/
///////////////////////////////////////////////////////////////////////////////
// //
// AliMemArray //
fBufferSize =buffersize;
}
-AliMemArray::AliMemArray(const AliMemArray & arr)
+AliMemArray::AliMemArray(const AliMemArray & arr):
+ TObject(arr)
{
//
//copy constructor
void Reserve2D(UInt_t n);
//
protected:
- virtual void CTORBuffer(void *buffer, UInt_t size){;} //array placement constructor
- virtual void DTORBuffer(void *buffer, UInt_t size){;} //array placement destructor
+ virtual void CTORBuffer(void */*buffer*/, UInt_t /*size*/){;} //array placement constructor
+ virtual void DTORBuffer(void */*buffer*/, UInt_t /*size*/){;} //array placement destructor
virtual void CopyBuffer(void *src, void *dest, UInt_t size); //array placement copy constructor
UInt_t fSize; //total number of valid objects
UInt_t fCapacity; //capacity of array
* provided "as is" without express or implied warranty. *
**************************************************************************/
-/*
-$Log$
-*/
+/* $Id$ */
+
///////////////////////////////////////////////////////////////////////////////
// //
// AliObjectArray //
SetClass(classname);
}
-AliObjectArray::AliObjectArray(const AliObjectArray &arr)
+AliObjectArray::AliObjectArray(const AliObjectArray &arr):
+ AliMemArray(arr)
{
//
//
* provided "as is" without express or implied warranty. *
**************************************************************************/
-/*
-$Log$
-Revision 1.9 2002/10/14 14:55:34 hristov
-Merging the VirtualMC branch to the main development branch (HEAD)
-
-Revision 1.7.6.1 2002/06/10 15:00:53 hristov
-Merged with v3-08-02
-
-Revision 1.8 2002/04/04 16:38:52 kowal2
-Digits and Sdigits go to separate files
-
-Revision 1.7 2001/10/21 18:22:54 hristov
-BranchOld replaced by Branch. It works correctly with Root 2.02.xx
-
-Revision 1.6 2001/08/30 09:25:24 hristov
-The operator[] is replaced by At() or AddAt() in case of TObjArray. A temporary replacement of Branch with BranchOld is introduced
-
-Revision 1.5 2001/07/27 13:03:11 hristov
-Default Branch split level set to 99
-
-Revision 1.4 2001/06/07 18:23:52 buncic
-TPC branches now correctly diverted into Digits.TPS.root file
-
-Revision 1.3 2001/02/05 14:34:54 hristov
-Avoid deleting of Root class dictionary (R.Brun, M.Ivanov)
-
-Revision 1.2 2001/01/26 20:29:00 hristov
-Major upgrade of AliRoot code
-
-Revision 1.1 2000/11/01 15:57:13 kowal2
-Moved from the TPC directory
-
-Revision 1.3 2000/06/30 12:07:49 kowal2
-Updated from the TPC-PreRelease branch
-
-Revision 1.2.4.1 2000/06/25 08:38:41 kowal2
-Splitted from AliTPCtracking
-
-Revision 1.2 2000/04/17 09:37:33 kowal2
-removed obsolete AliTPCDigitsDisplay.C
-
-Revision 1.1.4.2 2000/04/10 11:39:36 kowal2
-
-New data structure handling
-
-*/
+/* $Id$ */
///////////////////////////////////////////////////////////////////////////////
// //
///////////////////////////////////////////////////////////////////////////////
#include <Riostream.h>
-#include <TROOT.h>
#include <TTree.h>
+#include <TROOT.h>
+#include "AliRun.h"
+
#include "TClonesArray.h"
#include "TDirectory.h"
#include "AliArrayI.h"
#include "TClass.h"
#include "TFile.h"
-#include "AliRun.h"
#include "AliSegmentID.h"
#include "AliSegmentArray.h"
#include "TObjString.h"
fTree = 0;
fClass = 0;
fBranch = 0;
+ fTreeOwner = kFALSE;
}
AliSegmentArray::AliSegmentArray(Text_t *classname, Int_t n)
// Create an array of objects of classname. The class must inherit from
// AliSegmentID . The second argument adjust number of entries in
// the array.
+ fTreeOwner = kFALSE;
fNSegment=0;
fSegment =0;
fTreeIndex = 0;
}
}
-AliSegmentArray::AliSegmentArray(const AliSegmentArray &segment)
+AliSegmentArray::AliSegmentArray(const AliSegmentArray &segment):
+ TNamed(segment)
{
//
//copy constructor
// to be later implemented
}
-AliSegmentArray &AliSegmentArray::operator = (const AliSegmentArray & segment)
+AliSegmentArray &AliSegmentArray::operator = (const AliSegmentArray & /*segment*/)
{
//assignment operator
//to be later implemented
fSegment->Delete();
delete fSegment;
}
- if (fTree) delete fTree;
+ if (fTree)
+ if (fTreeOwner) delete fTree;
+ else fTree->Reset();
+
if (fTreeIndex) delete fTreeIndex;
// if (fClass!=0) delete fClass;
}
fClass = 0;
}
if (fTree !=0) {
- delete fTree;
+ if (fTreeOwner) delete fTree;
+ else fTree->Reset();
fTree = 0;
fBranch = 0;
delete fTreeIndex;
fTreeIndex = 0;
}
+
if (fSegment != 0) {
fSegment->Delete();
delete fSegment;
fSegment = 0;
}
+
if (!gROOT)
::Fatal("AliSegmentArray::AliSegmentArray", "ROOT system not initialized");
if (fSegment) return kTRUE;
else return kFALSE;
}
+void AliSegmentArray::MakeTree(TTree* tree)
+{
+ //Make tree with the name
+ AliSegmentID * psegment = NewSegment();
+ fTree = tree;
+ //PH fBranch = fTree->Branch("Segment",psegment->IsA()->GetName(),&psegment,64000);
+ fBranch = fTree->Branch("Segment",psegment->IsA()->GetName(),&psegment,64000,99);
+}
void AliSegmentArray::MakeTree(char *file)
{
// AliSegmentID segment;
AliSegmentID * psegment = NewSegment();
- if (fTree) delete fTree;
- fTree = new TTree("Segment Tree","Tree with segments");
+ if (fTree)
+ if (fTreeOwner)
+ {
+ delete fTree;
+ fTree = new TTree("Segment Tree","Tree with segments");
+ }
+ else fTree->Reset();
+
+
//PH fBranch = fTree->Branch("Segment",psegment->IsA()->GetName(),&psegment,64000);
fBranch = fTree->Branch("Segment",psegment->IsA()->GetName(),&psegment,64000,99);
- if (file) {
+
+ if (file) {
TString outFile = gAlice->GetBaseFile();
outFile = outFile + "/" + file;
fBranch->SetFile(outFile.Data());
while ((b=(TBranch*)next())) {
b->SetFile(outFile.Data());
}
- cout << "Diverting branch " << "Segment" << " to file " << outFile << endl;
+ cout << "Diverting branch " << "Segment" << " to file " << outFile << endl;
wd->cd();
}
delete psegment;
}
-////////////////////////////////////////////////////////////////////////
-TTree* AliSegmentArray::MakeTree(TFile *file)
-{
- //
- // create the whole tree in the file file
- //
- AliSegmentID * psegment = NewSegment();
- if (fTree) delete fTree;
- TDirectory *wd = gDirectory;
- file->cd();
- fTree = new TTree("Segment Tree","Tree with segments");
- fBranch = fTree->Branch("Segment",psegment->IsA()->GetName(),&psegment,64000,99);
- wd->cd();
- delete psegment;
- return fTree;
-}
-////////////////////////////////////////////////////////////////////////
Bool_t AliSegmentArray::MakeDictionary(Int_t size)
{
return kTRUE;
}
+Bool_t AliSegmentArray::ConnectTree(TTree* tree)
+{
+ fTree =tree;
+ if (fTree == 0) return kFALSE;
+ fBranch = fTree->GetBranch("Segment");
+ if (fBranch==0) return kFALSE;
+ MakeDictionary(TMath::Max(fNSegment,Int_t(fTree->GetEntries())));
+ MakeArray(fTreeIndex->fN);
+ return kTRUE;
+}
+
+
Bool_t AliSegmentArray::ConnectTree(const char * treeName)
{
//connect tree from current directory
if (fTree){
- delete fTree;
- fTree = 0;
- fBranch = 0;
+ if (fTreeOwner)
+ {
+ delete fTree;
+ fTree = 0;
+ }
+ else fTree->Reset();
+ fBranch = 0;
}
fTree =(TTree*)gDirectory->Get(treeName);
+
if (fTree == 0) return kFALSE;
fBranch = fTree->GetBranch("Segment");
if (fBranch==0) return kFALSE;
Version_t R__v = R__b.ReadVersion(); if (R__v) { }
TNamed::Streamer(R__b);
R__b>>ptreeName;
- if (fTree) delete fTree;
+ if (fTree && fTreeOwner) delete fTree;
ConnectTree(ptreeName->String());
} else {
R__b.WriteVersion(AliSegmentArray::IsA());
fTree->Write();
}
}
+
//input output functions
TTree * GetTree(){return fTree;} //return pointer to connected tree
- virtual void MakeTree(char *file=0); //Make tree with the name
- virtual TTree* MakeTree(TFile *file); //Make tree in the file file
+ virtual void MakeTree(char *file=0); //Make tree with the name
+ virtual void MakeTree(TTree* tree); //Make tree with the name
+
virtual Bool_t ConnectTree(const char * treeName); //connect tree from current directory
+ virtual Bool_t ConnectTree(TTree* tree); //connect tree from current directory
+
virtual AliSegmentID * LoadSegment(Int_t index);//load segment with index to the memory
virtual AliSegmentID * LoadEntry(Int_t index); //load segment entry from position index in tree
virtual void StoreSegment(Int_t index);//write segmen persistent
AliArrayI * fTreeIndex; //!pointers(index) table in tree
Int_t fNSegment; //number of alocated segments
TTree * fTree; //!tree with segment objects
- TBranch * fBranch; //!total branch
+ Bool_t fTreeOwner;// flag determing the ownership of the fTree
+ TBranch * fBranch; //!total branch
private:
TClass * fClass; //!class type of included objects
- ClassDef(AliSegmentArray,1)
+ ClassDef(AliSegmentArray,2)
};
* provided "as is" without express or implied warranty. *
**************************************************************************/
-/*
-$Log$
-Revision 1.2 2000/04/17 09:37:33 kowal2
-removed obsolete AliTPCDigitsDisplay.C
-
-Revision 1.1.4.2 2000/04/10 11:39:36 kowal2
-
-New data structure handling
-
-*/
+/* $Id$ */
///////////////////////////////////////////////////////////////////////////////
// //
* provided "as is" without express or implied warranty. *
**************************************************************************/
-/*
-$Log$
-Revision 1.2 2001/01/10 09:32:50 kowal2
-Changes to obey the coding rules.
+/* $Id$ */
-Revision 1.1 2000/11/01 16:01:26 kowal2
-Classes for handling the new hits structures
-
-*/
#include "TArrayOfArray.h"
#include "Riostream.h"
DHDR:= CONTAINERSLinkDef.h
-EINCLUDE:= TPC
* provided "as is" without express or implied warranty. *
**************************************************************************/
-/*
-$Log$
-Revision 1.6 2002/10/14 14:55:34 hristov
-Merging the VirtualMC branch to the main development branch (HEAD)
-
-Revision 1.4.2.2 2002/10/10 14:40:31 hristov
-Updating VirtualMC to v3-09-02
-
-Revision 1.5 2002/10/07 11:12:26 gamez
-Cleaned up version
-
-Revision 1.4 2002/07/12 12:56:18 gamez
-Material numbers, correction
-
-Revision 1.3.2.1 2002/07/12 12:31:30 gamez
-Material numbers, correction
-
-Revision 1.3 2002/07/10 15:53:10 gamez
-Molasse redefinition
-
-Revision 1.2 2002/07/09 08:45:35 hristov
-Old style include files needed on HP (aCC)
-
-Revision 1.1 2002/06/16 17:08:19 hristov
-First version of CRT
-
-
-*/
+/* $Id$ */
///////////////////////////////////////////////////////////////////////////////
// //
///////////////////////////////////////////////////////////////////////////////
#include <TTree.h>
-
-#include "AliRun.h"
-#include "AliMagF.h"
+#include <TVirtualMC.h>
#include "AliCRT.h"
#include "AliCRTConstants.h"
#include "AliCRThit.h"
-
+#include "AliLoader.h"
+#include "AliMagF.h"
+#include "AliRun.h"
ClassImp(AliCRT)
sprintf(branchname,"%s",GetName());
// Branch address for hit tree
- TTree *treeH = gAlice->TreeH();
+ TTree *treeH = fLoader->TreeH();
if (treeH && fHits) {
branch = treeH->GetBranch(branchname);
if (branch) branch->SetAddress(&fHits);
/*
$Log$
+Revision 1.3.4.1 2002/11/26 16:32:24 hristov
+Merging NewIO with v3-09-04
+
+Revision 1.3 2002/10/14 14:55:34 hristov
+Merging the VirtualMC branch to the main development branch (HEAD)
+
Revision 1.1.4.2 2002/10/10 14:40:31 hristov
Updating VirtualMC to v3-09-02
/*
$Log$
+Revision 1.6.4.1 2002/11/26 16:32:24 hristov
+Merging NewIO with v3-09-04
+
+Revision 1.6 2002/10/14 14:55:34 hristov
+Merging the VirtualMC branch to the main development branch (HEAD)
+
Revision 1.1.4.3 2002/10/10 14:40:31 hristov
Updating VirtualMC to v3-09-02
* provided "as is" without express or implied warranty. *
**************************************************************************/
-/*
-$Log$
-Revision 1.10 2002/10/29 17:20:37 hristov
-Corrections for subscript out of range (Alpha)
-
-Revision 1.9 2002/10/23 06:47:56 alibrary
-Introducing Riostream.h
-
-Revision 1.8 2002/10/14 14:55:34 hristov
-Merging the VirtualMC branch to the main development branch (HEAD)
-
-Revision 1.4.2.4 2002/10/10 14:40:31 hristov
-Updating VirtualMC to v3-09-02
-
-Revision 1.7 2002/10/07 11:13:25 gamez
-Access shafts added
-
-Revision 1.6 2002/07/26 06:21:12 gamez
-CRT3 volume taken as sensitive volume
-
-Revision 1.5 2002/07/25 12:52:34 morsch
-AddHit call only if hit has been defined.
-
-Revision 1.4 2002/07/12 12:57:29 gamez
-Division of CRT1 corrected
-
-Revision 1.3.2.1 2002/07/12 12:32:50 gamez
-Division of CRT1 corrected
-
-Revision 1.3 2002/07/10 15:57:04 gamez
-CreateHall() removed, and new Molasse volumes
-
-Revision 1.2 2002/07/09 08:45:35 hristov
-Old style include files needed on HP (aCC)
-
-Revision 1.1 2002/06/16 17:08:19 hristov
-First version of CRT
-
-
-*/
+/* $Id$ */
///////////////////////////////////////////////////////////////////////////////
// //
#include <Riostream.h>
-#include <TGeometry.h>
#include <TBRIK.h>
-#include <TNode.h>
+#include <TGeometry.h>
#include <TLorentzVector.h>
+#include <TNode.h>
+#include <TVirtualMC.h>
-#include "AliRun.h"
-#include "AliMagF.h"
+#include "AliCRTConstants.h"
+#include "AliCRTv0.h"
#include "AliConst.h"
+#include "AliMagF.h"
#include "AliPDG.h"
-
-#include "AliCRTv0.h"
-#include "AliCRTConstants.h"
+#include "AliRun.h"
ClassImp(AliCRTv0)
* provided "as is" without express or implied warranty. *
**************************************************************************/
-/*
-$Log$
-Revision 1.4 2002/11/21 19:34:52 alibrary
-Removing AliMC and AliMCProcess
-
-Revision 1.3 2002/10/23 06:47:56 alibrary
-Introducing Riostream.h
-
-Revision 1.2 2002/10/14 14:55:34 hristov
-Merging the VirtualMC branch to the main development branch (HEAD)
-
-Revision 1.1.2.1 2002/10/10 14:40:31 hristov
-Updating VirtualMC to v3-09-02
-
-Revision 1.1 2002/10/07 11:22:53 gamez
-First version, stand alone detector
-
-
-*/
+/* $Id$ */
///////////////////////////////////////////////////////////////////////////////
// //
///////////////////////////////////////////////////////////////////////////////
-#include <Riostream.h>
#include <TBRIK.h>
#include <TGeometry.h>
#include <TLorentzVector.h>
#include <TNode.h>
#include <TPDGCode.h>
-
#include "AliCRTConstants.h"
#include "AliCRTv1.h"
#include "AliConst.h"
* provided "as is" without express or implied warranty. *
**************************************************************************/
-/*
-$Log$
-Revision 1.4 2002/11/21 19:34:52 alibrary
-Removing AliMC and AliMCProcess
-
-Revision 1.3 2002/10/23 06:47:56 alibrary
-Introducing Riostream.h
-
-Revision 1.2 2002/10/14 14:55:34 hristov
-Merging the VirtualMC branch to the main development branch (HEAD)
-
-Revision 1.1.2.1 2002/10/10 14:40:31 hristov
-Updating VirtualMC to v3-09-02
-
-Revision 1.1 2002/10/07 11:25:28 gamez
-First version, generation of cosmic muons on the surface
-
-
-*/
+/* $Id$ */
/////////////////////////////////////////////////////////////////////////////
//
/////////////////////////////////////////////////////////////////////////////
#include <Riostream.h>
+
#include <TMCProcess.h>
#include <TPDGCode.h>
// --- ROOT system ---
class TFile;
-#include "TBranch.h"
-#include "TClonesArray.h"
-#include "TTree.h"
+#include <TFolder.h>
+#include <TROOT.h>
+#include <TTree.h>
+#include <TVirtualMC.h>
// --- Standard library ---
#include <Rstrstream.h>
// --- AliRoot header files ---
-#include "AliEMCAL.h"
-#include "AliRun.h"
#include "AliMagF.h"
+#include "AliEMCAL.h"
#include "AliEMCALGeometry.h"
+#include "AliEMCALLoader.h"
//#include "AliEMCALQAChecker.h"
+#include "AliRun.h"
ClassImp(AliEMCAL)
//____________________________________________________________________________
{
// ctor : title is used to identify the layout
- fGeom = AliEMCALGeometry::GetInstance(GetTitle(),"") ;
//fQATask = 0;
fTreeQA = 0;
}
sprintf(branchname,"%s",GetName());
// Branch address for hit tree
- TTree *treeH = gAlice->TreeH();
- if (treeH && fHits) {
+ TTree *treeH = TreeH();
+ if (treeH) {
branch = treeH->GetBranch(branchname);
- if (branch) branch->SetAddress(&fHits);
+ if (branch)
+ {
+ if (fHits == 0x0) fHits= new TClonesArray("AliEMCALHit",1000);
+ //Info("SetTreeAddress","<%s> Setting Hits Address",GetName());
+ branch->SetAddress(&fHits);
+ }
+ else
+ {
+ Warning("SetTreeAddress","<%s> Failed",GetName());
+ }
}
}
-
//____________________________________________________________________________
void AliEMCAL::WriteQA()
{
-
+
// Make TreeQA in the output file.
-
+
if(fTreeQA == 0)
fTreeQA = new TTree("TreeQA", "QA Alarms") ;
// Create Alarms branches
-// Int_t bufferSize = 32000 ;
-// Int_t splitlevel = 0 ;
-// TFolder * alarmsF = (TFolder*)gROOT->FindObjectAny("Folders/Run/Conditions/QA/PHOS") ;
-// TString branchName(alarmsF->GetName());
-// TBranch * alarmsBranch = fTreeQA->Branch(branchName,"TFolder", &alarmsF, bufferSize, splitlevel);
-// TString branchTitle = branchName + " QA alarms" ;
-// alarmsBranch->SetTitle(branchTitle);
-// alarmsBranch->Fill() ;
-
- //fTreeQA->Fill() ;
+ Int_t bufferSize = 32000 ;
+ Int_t splitlevel = 0 ;
+
+ TFolder* topfold = GetLoader()->GetTopFolder(); //get top aliroot folder; skowron
+ TString emcalqafn(AliConfig::Instance()->GetQAFolderName()+"/"); //get name of QAaut folder relative to top event; skowron
+ emcalqafn+=GetName(); //hard wired string!!! add the detector name to the pathname; skowron
+ TFolder * alarmsF = (TFolder*)topfold->FindObjectAny(emcalqafn); //get the folder
+
+ if (alarmsF == 0x0)
+ {
+ Error("WriteQA","Can not find folder with qa alarms");
+ return;
+ }
+ TString branchName(alarmsF->GetName());
+ TBranch * alarmsBranch = fTreeQA->Branch(branchName,"TFolder", &alarmsF, bufferSize, splitlevel);
+ TString branchTitle = branchName + " QA alarms" ;
+ alarmsBranch->SetTitle(branchTitle);
+ alarmsBranch->Fill() ;
+
+ //fTreeQA
}
+//____________________________________________________________________________
+AliLoader* AliEMCAL::MakeLoader(const char* topfoldername)
+{
+//different behaviour than standard (singleton getter)
+// --> to be discussed and made eventually coherent
+ fLoader = new AliEMCALLoader(GetName(),topfoldername);
+ return fLoader;
+}
return *this ;
}
+ virtual AliLoader* MakeLoader(const char* topfoldername);
+
protected:
//AliEMCALQAChecker * fQATask ; //! PHOS checkers container
AliEMCALClusterizer::AliEMCALClusterizer():TTask("","")
{
// ctor
- fSplitFile = 0 ;
- fToSplit = kFALSE ;
-
+ fEventFolderName = "" ;
}
//____________________________________________________________________________
-AliEMCALClusterizer::AliEMCALClusterizer(const char* headerFile, const char* name, const Bool_t toSplit):
-TTask(name, headerFile)
+AliEMCALClusterizer::AliEMCALClusterizer(const TString alirunFileName, const TString eventFolderName):
+ TTask("EMCAL"+AliConfig::fgkReconstructionerTaskName, alirunFileName), fEventFolderName(eventFolderName)
{
// ctor
- fToSplit = toSplit ;
- fSplitFile = 0 ;
-
+
}
//____________________________________________________________________________
AliEMCALClusterizer::~AliEMCALClusterizer()
{
// dtor
-
- fSplitFile = 0 ;
- }
+}
// --- Standard library ---
// --- AliRoot header files ---
-
-//#include "AliEMCALDigit.h"
+#include "AliConfig.h"
class AliEMCALClusterizer : public TTask {
public:
AliEMCALClusterizer() ; // default ctor
- AliEMCALClusterizer(const char * headerFile, const char * name, const Bool_t toSplit) ;
+ AliEMCALClusterizer(const TString alirunFileName, const TString eventFolderName = AliConfig::fgkDefaultEventFolderName) ;
virtual ~AliEMCALClusterizer() ; // dtor
virtual Float_t GetTowerClusteringThreshold()const {Warning("GetTowerClusteringThreshold", "Not Defined") ; return 0. ; }
virtual const char * Version() const {Warning("Version", "Not Defined") ; return 0 ; }
protected:
-
- TFile * fSplitFile ; //! file in which RecPoints will eventually be stored
- Bool_t fToSplit ; //! Should we write to splitted file
+ TString fEventFolderName ; // event folder name
- ClassDef(AliEMCALClusterizer,2) // Clusterization algorithm class
+ ClassDef(AliEMCALClusterizer,3) // Clusterization algorithm class
} ;
// --- AliRoot header files ---
-
+#include "AliEMCALGetter.h"
#include "AliEMCALClusterizerv1.h"
+#include "AliEMCALTowerRecPoint.h"
#include "AliEMCALDigit.h"
#include "AliEMCALDigitizer.h"
-#include "AliEMCALTowerRecPoint.h"
#include "AliEMCAL.h"
-#include "AliEMCALGetter.h"
#include "AliEMCALGeometry.h"
-#include "AliRun.h"
ClassImp(AliEMCALClusterizerv1)
}
//____________________________________________________________________________
-AliEMCALClusterizerv1::AliEMCALClusterizerv1(const char* headerFile, const char* name, const Bool_t toSplit)
-:AliEMCALClusterizer(headerFile, name, toSplit)
+AliEMCALClusterizerv1::AliEMCALClusterizerv1(const TString alirunFileName, const TString eventFolderName)
+:AliEMCALClusterizer(alirunFileName, eventFolderName)
{
// ctor with the indication of the file where header Tree and digits Tree are stored
AliEMCALClusterizerv1::~AliEMCALClusterizerv1()
{
// dtor
- fSplitFile = 0 ;
}
//____________________________________________________________________________
const TString AliEMCALClusterizerv1::BranchName() const
{
- TString branchName(GetName() ) ;
- branchName.Remove(branchName.Index(Version())-1) ;
- return branchName ;
+ return GetName();
+
}
//____________________________________________________________________________
// where = 0 == PRE ; where = 1 == ECAL ; where = 2 == HCAL
if ( where == 0 ) // calibrate as PRE section
return -fADCpedestalPRE + amp * fADCchannelPRE ;
- else if (where == 1) //calibrate as EC section
- return -fADCpedestalEC + amp * fADCchannelEC ;
- else if (where == 2) //calibrate as HC section
- return -fADCpedestalHC + amp * fADCchannelHC ;
+ else if (where == 1) //calibrate as ECA section
+ return -fADCpedestalECA + amp * fADCchannelECA ;
+ else if (where == 2) //calibrate as HCA section
+ return -fADCpedestalHCA + amp * fADCchannelHCA ;
else
Fatal("Calibrate", "Something went wrong!") ;
return -9999999. ;
{
// Steering method
- if( strcmp(GetName(), "")== 0 )
- Init() ;
-
if(strstr(option,"tim"))
gBenchmark->Start("EMCALClusterizer");
if(strstr(option,"print"))
Print("") ;
- AliEMCALGetter * gime = AliEMCALGetter::GetInstance() ;
- if(gime->BranchExists("RecPoints"))
- return ;
+ AliEMCALGetter * gime = AliEMCALGetter::Instance() ;
+
Int_t nevents = gime->MaxEvent() ;
Int_t ievent ;
gime->Event(ievent,"D") ;
- if(ievent == 0)
- GetCalibrationParameters() ;
+ GetCalibrationParameters() ;
- fNumberOfPREClusters = fNumberOfECClusters = fNumberOfHCClusters = 0 ;
+ fNumberOfPREClusters = fNumberOfECAClusters = fNumberOfHCAClusters = 0 ;
MakeClusters() ;
if(strstr(option,"deb"))
PrintRecPoints(option) ;
- //increment the total number of digits per run
+ //increment the total number of recpoints per run
fRecPointsInRun += gime->PRERecPoints()->GetEntriesFast() ;
- fRecPointsInRun += gime->ECALRecPoints()->GetEntriesFast() ;
- fRecPointsInRun += gime->HCALRecPoints()->GetEntriesFast() ;
- }
+ fRecPointsInRun += gime->ECARecPoints()->GetEntriesFast() ;
+ fRecPointsInRun += gime->HCARecPoints()->GetEntriesFast() ;
+ }
+ Unload();
+
if(strstr(option,"tim")){
gBenchmark->Stop("EMCALClusterizer");
Info("Exec", "took %f seconds for Clusterizing %f seconds per event",
gBenchmark->GetCpuTime("EMCALClusterizer"), gBenchmark->GetCpuTime("EMCALClusterizer")/nevents ) ;
}
-
}
//____________________________________________________________________________
// The initial values for fitting procedure are set equal to the positions of local maxima.
// Cluster will be fitted as a superposition of nPar/3 electromagnetic showers
- AliEMCALGetter * gime = AliEMCALGetter::GetInstance() ;
+ AliEMCALGetter * gime = AliEMCALGetter::Instance() ;
TClonesArray * digits = gime->Digits() ;
//____________________________________________________________________________
void AliEMCALClusterizerv1::GetCalibrationParameters()
{
- AliEMCALGetter * gime = AliEMCALGetter::GetInstance() ;
- const AliEMCALDigitizer * dig = gime->Digitizer(BranchName()) ;
+ AliEMCALGetter * gime = AliEMCALGetter::Instance() ;
+ if ( !gime->Digitizer() )
+ gime->LoadDigitizer();
+ AliEMCALDigitizer * dig = gime->Digitizer();
+
fADCchannelPRE = dig->GetPREchannel() ;
fADCpedestalPRE = dig->GetPREpedestal() ;
- fADCchannelEC = dig->GetECchannel() ;
- fADCpedestalEC = dig->GetECpedestal();
+ fADCchannelECA = dig->GetECAchannel() ;
+ fADCpedestalECA = dig->GetECApedestal();
- fADCchannelHC = dig->GetHCchannel() ;
- fADCpedestalHC = dig->GetHCpedestal();
+ fADCchannelHCA = dig->GetHCAchannel() ;
+ fADCpedestalHCA = dig->GetHCApedestal();
}
//____________________________________________________________________________
// Make all memory allocations which can not be done in default constructor.
// Attach the Clusterizer task to the list of EMCAL tasks
- if ( strcmp(GetTitle(), "") == 0 )
- SetTitle("galice.root") ;
-
- TString branchname = GetName() ;
- branchname.Remove(branchname.Index(Version())-1) ;
+ AliEMCALGetter * gime = AliEMCALGetter::Instance(GetTitle(), fEventFolderName.Data());
- AliEMCALGetter * gime = AliEMCALGetter::GetInstance(GetTitle(), branchname.Data(), fToSplit ) ;
- if ( gime == 0 ) {
- Error("Init", "Could not obtain the Getter object !" ) ;
- return ;
- }
-
- fSplitFile = 0 ;
- if(fToSplit){
- // construct the name of the file as /path/EMCAL.SDigits.root
- //First - extract full path if necessary
- TString fileName(GetTitle()) ;
- Ssiz_t islash = fileName.Last('/') ;
- if(islash<fileName.Length())
- fileName.Remove(islash+1,fileName.Length()) ;
- else
- fileName="" ;
- // Next - append the file name
- fileName+="EMCAL.RecData." ;
- if((strcmp(branchname.Data(),"Default")!=0)&&(strcmp(branchname.Data(),"")!=0)){
- fileName+=branchname ;
- fileName+="." ;
- }
- fileName+="root" ;
- // Finally - check if the file already opened or open the file
- fSplitFile = static_cast<TFile*>(gROOT->GetFile(fileName.Data()));
- if(!fSplitFile)
- fSplitFile = TFile::Open(fileName.Data(),"update") ;
- }
+ AliEMCALGeometry * geom = gime->EMCALGeometry() ;
- const AliEMCALGeometry * geom = gime->EMCALGeometry() ;
fNTowers = geom->GetNZ() * geom->GetNPhi() ;
if(!gMinuit)
gMinuit = new TMinuit(100) ;
- gime->PostClusterizer(this) ;
- gime->PostRecPoints(branchname ) ;
-
+ if ( !gime->Clusterizer() )
+ gime->PostClusterizer(this);
}
//____________________________________________________________________________
void AliEMCALClusterizerv1::InitParameters()
{
- fNumberOfPREClusters = fNumberOfECClusters = fNumberOfHCClusters = 0 ;
+ fNumberOfPREClusters = fNumberOfECAClusters = fNumberOfHCAClusters = 0 ;
fPREClusteringThreshold = 0.0001; // must be adjusted according to the noise leve set by digitizer
- fECClusteringThreshold = 0.0045; // must be adjusted according to the noise leve set by digitizer
- fHCClusteringThreshold = 0.001; // must be adjusted according to the noise leve set by digitizer
+ fECAClusteringThreshold = 0.0045; // must be adjusted according to the noise leve set by digitizer
+ fHCAClusteringThreshold = 0.001; // must be adjusted according to the noise leve set by digitizer
fPRELocMaxCut = 0.03 ;
- fECLocMaxCut = 0.03 ;
- fHCLocMaxCut = 0.03 ;
+ fECALocMaxCut = 0.03 ;
+ fHCALocMaxCut = 0.03 ;
fPREW0 = 4.0 ;
- fECW0 = 4.5 ;
- fHCW0 = 4.5 ;
+ fECAW0 = 4.5 ;
+ fHCAW0 = 4.5 ;
fTimeGate = 1.e-8 ;
fToUnfold = kFALSE ;
-
- TString clusterizerName( GetName()) ;
- if (clusterizerName.IsNull() )
- clusterizerName = "Default" ;
- clusterizerName.Append(":") ;
- clusterizerName.Append(Version()) ;
- SetName(clusterizerName) ;
- fRecPointsInRun = 0 ;
-
+
+ fRecPointsInRun = 0 ;
+
}
//____________________________________________________________________________
// The order of d1 and d2 is important: first (d1) should be a digit already in a cluster
// which is compared to a digit (d2) not yet in a cluster
- AliEMCALGeometry * geom = AliEMCALGetter::GetInstance()->EMCALGeometry() ;
+ AliEMCALGeometry * geom = AliEMCALGetter::Instance()->EMCALGeometry() ;
Int_t rv = 0 ;
return rv ;
}
+//____________________________________________________________________________
+void AliEMCALClusterizerv1::Unload()
+{
+ AliEMCALGetter * gime = AliEMCALGetter::Instance() ;
+ gime->EmcalLoader()->UnloadDigits() ;
+ gime->EmcalLoader()->UnloadRecPoints() ;
+}
//____________________________________________________________________________
void AliEMCALClusterizerv1::WriteRecPoints(Int_t event)
// Creates new branches with given title
// fills and writes into TreeR.
- AliEMCALGetter *gime = AliEMCALGetter::GetInstance() ;
+ AliEMCALGetter *gime = AliEMCALGetter::Instance() ;
TObjArray * aPRERecPoints = gime->PRERecPoints() ;
- TObjArray * aECRecPoints = gime->ECALRecPoints() ;
- TObjArray * aHCRecPoints = gime->HCALRecPoints() ;
+ TObjArray * aECARecPoints = gime->ECARecPoints() ;
+ TObjArray * aHCARecPoints = gime->HCARecPoints() ;
TClonesArray * digits = gime->Digits() ;
- TTree * treeR ;
+ TTree * treeR = gime->TreeR(); ;
- if(fToSplit){
- if(!fSplitFile)
- return ;
- fSplitFile->cd() ;
- TString name("TreeR") ;
- name += event ;
- treeR = dynamic_cast<TTree*>(fSplitFile->Get(name));
- }
- else{
- treeR = gAlice->TreeR();
- }
-
- if(!treeR){
- gAlice->MakeTree("R", fSplitFile);
- treeR = gAlice->TreeR() ;
- }
-
Int_t index ;
//Evaluate position, dispersion and other RecPoint properties for PRE section
aPRERecPoints->Expand(aPRERecPoints->GetEntriesFast()) ;
//Evaluate position, dispersion and other RecPoint properties for EC section
- for(index = 0; index < aECRecPoints->GetEntries(); index++)
- (dynamic_cast<AliEMCALTowerRecPoint *>(aECRecPoints->At(index)))->EvalAll(fECW0,digits) ;
+ for(index = 0; index < aECARecPoints->GetEntries(); index++)
+ (dynamic_cast<AliEMCALTowerRecPoint *>(aECARecPoints->At(index)))->EvalAll(fECAW0,digits) ;
- aECRecPoints->Sort() ;
+ aECARecPoints->Sort() ;
- for(index = 0; index < aECRecPoints->GetEntries(); index++)
- (dynamic_cast<AliEMCALTowerRecPoint *>(aECRecPoints->At(index)))->SetIndexInList(index) ;
+ for(index = 0; index < aECARecPoints->GetEntries(); index++)
+ (dynamic_cast<AliEMCALTowerRecPoint *>(aECARecPoints->At(index)))->SetIndexInList(index) ;
- aECRecPoints->Expand(aECRecPoints->GetEntriesFast()) ;
+ aECARecPoints->Expand(aECARecPoints->GetEntriesFast()) ;
- //Evaluate position, dispersion and other RecPoint properties for HC section
- for(index = 0; index < aHCRecPoints->GetEntries(); index++)
- (dynamic_cast<AliEMCALTowerRecPoint *>(aHCRecPoints->At(index)))->EvalAll(fHCW0,digits) ;
+ //Evaluate position, dispersion and other RecPoint properties for HCA section
+ for(index = 0; index < aHCARecPoints->GetEntries(); index++)
+ (dynamic_cast<AliEMCALTowerRecPoint *>(aHCARecPoints->At(index)))->EvalAll(fHCAW0,digits) ;
- aHCRecPoints->Sort() ;
+ aHCARecPoints->Sort() ;
- for(index = 0; index < aHCRecPoints->GetEntries(); index++)
- (dynamic_cast<AliEMCALTowerRecPoint *>(aHCRecPoints->At(index)))->SetIndexInList(index) ;
+ for(index = 0; index < aHCARecPoints->GetEntries(); index++)
+ (dynamic_cast<AliEMCALTowerRecPoint *>(aHCARecPoints->At(index)))->SetIndexInList(index) ;
- aHCRecPoints->Expand(aHCRecPoints->GetEntriesFast()) ;
+ aHCARecPoints->Expand(aHCARecPoints->GetEntriesFast()) ;
Int_t bufferSize = 32000 ;
Int_t splitlevel = 0 ;
branchPRE->SetTitle(BranchName());
//EC section branch
- TBranch * branchEC = treeR->Branch("EMCALECRP","TObjArray",&aECRecPoints,bufferSize,splitlevel);
- branchEC->SetTitle(BranchName());
+ TBranch * branchECA = treeR->Branch("EMCALECARP","TObjArray",&aECARecPoints,bufferSize,splitlevel);
+ branchECA->SetTitle(BranchName());
- //HC section branch
- TBranch * branchHC = treeR->Branch("EMCALHCRP","TObjArray",&aHCRecPoints,bufferSize,splitlevel);
- branchHC->SetTitle(BranchName());
-
- //And Finally clusterizer branch
- AliEMCALClusterizerv1 * cl = (AliEMCALClusterizerv1*)gime->Clusterizer(BranchName()) ;
- TBranch * clusterizerBranch = treeR->Branch("AliEMCALClusterizer","AliEMCALClusterizerv1",
- &cl,bufferSize,splitlevel);
- clusterizerBranch->SetTitle(BranchName());
+ //HCA section branch
+ TBranch * branchHCA = treeR->Branch("EMCALHCARP","TObjArray",&aHCARecPoints,bufferSize,splitlevel);
+ branchHCA->SetTitle(BranchName());
branchPRE->Fill() ;
- branchEC->Fill() ;
- branchHC->Fill() ;
- clusterizerBranch->Fill() ;
+ branchECA->Fill() ;
+ branchHCA->Fill() ;
- treeR->AutoSave() ; //Write(0,kOverwrite) ;
- if(gAlice->TreeR()!=treeR)
- treeR->Delete();
+ gime->WriteRecPoints("OVERWRITE");
+ gime->WriteClusterizer("OVERWRITE");
}
//____________________________________________________________________________
// Steering method to construct the clusters stored in a list of Reconstructed Points
// A cluster is defined as a list of neighbour digits
- AliEMCALGetter * gime = AliEMCALGetter::GetInstance() ;
+ AliEMCALGetter * gime = AliEMCALGetter::Instance() ;
AliEMCALGeometry * geom = gime->EMCALGeometry() ;
- TObjArray * aPRERecPoints = gime->PRERecPoints(BranchName()) ;
- TObjArray * aECRecPoints = gime->ECALRecPoints(BranchName()) ;
- TObjArray * aHCRecPoints = gime->HCALRecPoints(BranchName()) ;
+ TObjArray * aPRERecPoints = gime->PRERecPoints() ;
+ TObjArray * aECARecPoints = gime->ECARecPoints() ;
+ TObjArray * aHCARecPoints = gime->HCARecPoints() ;
aPRERecPoints->Delete() ;
- aECRecPoints->Delete() ;
- aHCRecPoints->Delete() ;
+ aECARecPoints->Delete() ;
+ aHCARecPoints->Delete() ;
TClonesArray * digits = gime->Digits() ;
- if ( !digits ) {
- Fatal("MakeClusters -> Digits with name %s not found", GetName() ) ;
- }
TIter next(digits) ;
AliEMCALDigit * digit ;
- Int_t ndigEC=0, ndigPRE=0, ndigHC=0 ;
+ Int_t ndigECA=0, ndigPRE=0, ndigHCA=0 ;
- // count the number of digits in EC section
+ // count the number of digits in ECA section
while ( (digit = dynamic_cast<AliEMCALDigit *>(next())) ) { // scan over the list of digits
- if (geom->IsInECAL(digit->GetId()))
- ndigEC++ ;
+ if (geom->IsInECA(digit->GetId()))
+ ndigECA++ ;
else if (geom->IsInPRE(digit->GetId()))
ndigPRE++;
- else if (geom->IsInHCAL(digit->GetId()))
- ndigHC++;
+ else if (geom->IsInHCA(digit->GetId()))
+ ndigHCA++;
else {
Error("MakeClusters", "id = %d is a wrong ID!", digit->GetId()) ;
abort() ;
}
}
- // add amplitude of PRE and EC sections
- Int_t digEC ;
- for (digEC = 0 ; digEC < ndigEC ; digEC++) {
- digit = dynamic_cast<AliEMCALDigit *>(digits->At(digEC)) ;
+ // add amplitude of PRE and ECA sections
+ Int_t digECA ;
+ for (digECA = 0 ; digECA < ndigECA ; digECA++) {
+ digit = dynamic_cast<AliEMCALDigit *>(digits->At(digECA)) ;
Int_t digPRE ;
- for (digPRE = ndigEC ; digPRE < ndigEC+ndigPRE ; digPRE++) {
+ for (digPRE = ndigECA ; digPRE < ndigECA+ndigPRE ; digPRE++) {
AliEMCALDigit * digitPRE = dynamic_cast<AliEMCALDigit *>(digits->At(digPRE)) ;
if ( geom->AreInSameTower(digit->GetId(), digitPRE->GetId()) ){
Float_t amp = static_cast<Float_t>(digit->GetAmp()) + geom->GetSummationFraction() * static_cast<Float_t>(digitPRE->GetAmp()) + 0.5 ;
// Clusterization starts
TIter nextdigit(digitsC) ;
- Bool_t notremovedEC = kTRUE, notremovedPRE = kTRUE ;
+ Bool_t notremovedECA = kTRUE, notremovedPRE = kTRUE ;
while ( (digit = dynamic_cast<AliEMCALDigit *>(nextdigit())) ) { // scan over the list of digitsC
AliEMCALRecPoint * clu = 0 ;
- TArrayI clusterPREdigitslist(50), clusterECdigitslist(50), clusterHCdigitslist(50);
+ TArrayI clusterPREdigitslist(50), clusterECAdigitslist(50), clusterHCAdigitslist(50);
- Bool_t inPRE = kFALSE, inECAL = kFALSE, inHCAL = kFALSE ;
+ Bool_t inPRE = kFALSE, inECA = kFALSE, inHCA = kFALSE ;
if( geom->IsInPRE(digit->GetId()) ) {
inPRE = kTRUE ;
}
- else if( geom->IsInECAL(digit->GetId()) ) {
- inECAL = kTRUE ;
+ else if( geom->IsInECA(digit->GetId()) ) {
+ inECA = kTRUE ;
}
- else if( geom->IsInHCAL(digit->GetId()) ) {
- inHCAL = kTRUE ;
+ else if( geom->IsInHCA(digit->GetId()) ) {
+ inHCA = kTRUE ;
}
if (gDebug == 2) {
if (inPRE)
Info("MakeClusters","id = %d, ene = %f , thre = %f ",
digit->GetId(),Calibrate(digit->GetAmp(), 0), fPREClusteringThreshold) ;
- if (inECAL)
+ if (inECA)
Info("MakeClusters","id = %d, ene = %f , thre = %f",
- digit->GetId(),Calibrate(digit->GetAmp(), 1), fECClusteringThreshold) ;
- if (inHCAL)
+ digit->GetId(),Calibrate(digit->GetAmp(), 1), fECAClusteringThreshold) ;
+ if (inHCA)
Info("MakeClusters","id = %d, ene = %f , thre = %f",
- digit->GetId(),Calibrate(digit->GetAmp(), 2), fHCClusteringThreshold ) ;
+ digit->GetId(),Calibrate(digit->GetAmp(), 2), fHCAClusteringThreshold ) ;
}
if ( (inPRE && (Calibrate(digit->GetAmp(), 0) > fPREClusteringThreshold )) ||
- (inECAL && (Calibrate(digit->GetAmp(), 1) > fECClusteringThreshold )) ||
- (inHCAL && (Calibrate(digit->GetAmp(), 2) > fHCClusteringThreshold )) ) {
+ (inECA && (Calibrate(digit->GetAmp(), 1) > fECAClusteringThreshold )) ||
+ (inHCA && (Calibrate(digit->GetAmp(), 2) > fHCAClusteringThreshold )) ) {
- Int_t iDigitInPRECluster = 0, iDigitInECCluster = 0, iDigitInHCCluster = 0;
+ Int_t iDigitInPRECluster = 0, iDigitInECACluster = 0, iDigitInHCACluster = 0;
Int_t where ; // PRE = 0, ECAl = 1, HCAL = 2
// Find the seed in each of the section ECAL/PRE/HCAL
- if( geom->IsInECAL(digit->GetId()) ) {
+ if( geom->IsInECA(digit->GetId()) ) {
where = 1 ; // to tell we are in ECAL
// start a new Tower RecPoint
- if(fNumberOfECClusters >= aECRecPoints->GetSize())
- aECRecPoints->Expand(2*fNumberOfECClusters+1) ;
+ if(fNumberOfECAClusters >= aECARecPoints->GetSize())
+ aECARecPoints->Expand(2*fNumberOfECAClusters+1) ;
AliEMCALTowerRecPoint * rp = new AliEMCALTowerRecPoint("") ;
- rp->SetECAL() ;
- aECRecPoints->AddAt(rp, fNumberOfECClusters) ;
- clu = dynamic_cast<AliEMCALTowerRecPoint *>(aECRecPoints->At(fNumberOfECClusters)) ;
- fNumberOfECClusters++ ;
+ rp->SetECA() ;
+ aECARecPoints->AddAt(rp, fNumberOfECAClusters) ;
+ clu = dynamic_cast<AliEMCALTowerRecPoint *>(aECARecPoints->At(fNumberOfECAClusters)) ;
+ fNumberOfECAClusters++ ;
clu->AddDigit(*digit, Calibrate(digit->GetAmp(), where)) ;
- clusterECdigitslist[iDigitInECCluster] = digit->GetIndexInList() ;
- iDigitInECCluster++ ;
+ clusterECAdigitslist[iDigitInECACluster] = digit->GetIndexInList() ;
+ iDigitInECACluster++ ;
digitsC->Remove(digit) ;
if (gDebug == 2 )
- Info("MakeClusters","OK id = %d, ene = %f , thre = %f ", digit->GetId(),Calibrate(digit->GetAmp(), 1), fECClusteringThreshold) ;
+ Info("MakeClusters","OK id = %d, ene = %f , thre = %f ", digit->GetId(),Calibrate(digit->GetAmp(), 1), fECAClusteringThreshold) ;
}
else if( geom->IsInPRE(digit->GetId()) ) {
nextdigit.Reset() ;
- // Here we remove remaining EC digits, which cannot make a cluster
+ // Here we remove remaining ECA digits, which cannot make a cluster
- if( notremovedEC ) {
+ if( notremovedECA ) {
while( ( digit = dynamic_cast<AliEMCALDigit *>(nextdigit()) ) ) {
- if( geom->IsInECAL(digit->GetId()) )
+ if( geom->IsInECA(digit->GetId()) )
digitsC->Remove(digit) ;
else
break ;
}
- notremovedEC = kFALSE ;
+ notremovedECA = kFALSE ;
}
}
- else if( geom->IsInHCAL(digit->GetId()) ) {
+ else if( geom->IsInHCA(digit->GetId()) ) {
where = 2 ; // to tell we are in HCAL
// start a new HCAL cluster
- if(fNumberOfHCClusters >= aHCRecPoints->GetSize())
- aHCRecPoints->Expand(2*fNumberOfHCClusters+1);
+ if(fNumberOfHCAClusters >= aHCARecPoints->GetSize())
+ aHCARecPoints->Expand(2*fNumberOfHCAClusters+1);
AliEMCALTowerRecPoint * rp = new AliEMCALTowerRecPoint("") ;
- rp->SetHCAL() ;
- aHCRecPoints->AddAt(rp, fNumberOfHCClusters) ;
- clu = dynamic_cast<AliEMCALTowerRecPoint *>(aHCRecPoints->At(fNumberOfHCClusters)) ;
- fNumberOfHCClusters++ ;
+ rp->SetHCA() ;
+ aHCARecPoints->AddAt(rp, fNumberOfHCAClusters) ;
+ clu = dynamic_cast<AliEMCALTowerRecPoint *>(aHCARecPoints->At(fNumberOfHCAClusters)) ;
+ fNumberOfHCAClusters++ ;
clu->AddDigit(*digit, Calibrate(digit->GetAmp(), where));
- clusterHCdigitslist[iDigitInHCCluster] = digit->GetIndexInList() ;
- iDigitInHCCluster++ ;
+ clusterHCAdigitslist[iDigitInHCACluster] = digit->GetIndexInList() ;
+ iDigitInHCACluster++ ;
digitsC->Remove(digit) ;
if (gDebug == 2 )
- Info("MakeClusters","OK id = %d, ene = %f , thre = %f ", digit->GetId(),Calibrate(digit->GetAmp(), 2), fHCClusteringThreshold) ;
+ Info("MakeClusters","OK id = %d, ene = %f , thre = %f ", digit->GetId(),Calibrate(digit->GetAmp(), 2), fHCAClusteringThreshold) ;
nextdigit.Reset() ;
// Do the Clustering in each of the three section ECAL/PRE/HCAL
- while (index < iDigitInECCluster){ // scan over digits already in cluster
- digit = (AliEMCALDigit*)digits->At(clusterECdigitslist[index]) ;
+ while (index < iDigitInECACluster){ // scan over digits already in cluster
+ digit = (AliEMCALDigit*)digits->At(clusterECAdigitslist[index]) ;
index++ ;
while ( (digitN = (AliEMCALDigit *)nextdigit()) ) { // scan over the reduced list of digits
Int_t ineb = AreNeighbours(digit, digitN); // call (digit,digitN) in THAT oder !!!!!
break ;
case 1 : // are neighbours
clu->AddDigit(*digitN, Calibrate( digitN->GetAmp(), 1) ) ;
- clusterECdigitslist[iDigitInECCluster] = digitN->GetIndexInList() ;
- iDigitInECCluster++ ;
+ clusterECAdigitslist[iDigitInECACluster] = digitN->GetIndexInList() ;
+ iDigitInECACluster++ ;
digitsC->Remove(digitN) ;
break ;
case 2 : // too far from each other
endofloop1: ;
nextdigit.Reset() ;
- } // loop over EC cluster
+ } // loop over ECA cluster
index = 0 ;
while (index < iDigitInPRECluster){ // scan over digits already in cluster
} // loop over PRE cluster
index = 0 ;
- while (index < iDigitInHCCluster){ // scan over digits already in cluster
- digit = (AliEMCALDigit*)digits->At(clusterHCdigitslist[index]) ;
+ while (index < iDigitInHCACluster){ // scan over digits already in cluster
+ digit = (AliEMCALDigit*)digits->At(clusterHCAdigitslist[index]) ;
index++ ;
while ( (digitN = (AliEMCALDigit *)nextdigit()) ) { // scan over the reduced list of digits
Int_t ineb = AreNeighbours(digit, digitN); // call (digit,digitN) in THAT oder !!!!!
break ;
case 1 : // are neighbours
clu->AddDigit(*digitN, Calibrate( digitN->GetAmp(), 2) ) ;
- clusterHCdigitslist[iDigitInHCCluster] = digitN->GetIndexInList() ;
- iDigitInHCCluster++ ;
+ clusterHCAdigitslist[iDigitInHCACluster] = digitN->GetIndexInList() ;
+ iDigitInHCACluster++ ;
digitsC->Remove(digitN) ;
break ;
case 2 : // too far from each other
endofloop3: ;
nextdigit.Reset() ;
- } // loop over HC cluster
+ } // loop over HCA cluster
} // energy theshold
} // while digit
message += fPRELocMaxCut ;
message += "\n Pre Shower Logarothmic weight = " ;
message += fPREW0 ;
- message += "\n EC Clustering threshold = " ;
- message += fECClusteringThreshold ;
- message += "\n EC Local Maximum cut = " ;
- message += fECLocMaxCut ;
- message += "\n EC Logarothmic weight = " ;
- message += fECW0 ;
+ message += "\n ECA Clustering threshold = " ;
+ message += fECAClusteringThreshold ;
+ message += "\n ECA Local Maximum cut = " ;
+ message += fECALocMaxCut ;
+ message += "\n ECA Logarothmic weight = " ;
+ message += fECAW0 ;
message += "\n Pre Shower Clustering threshold = " ;
- message += fHCClusteringThreshold ;
- message += "\n HC Local Maximum cut = " ;
- message += fHCLocMaxCut ;
- message += "\n HC Logarothmic weight = " ;
- message += fHCW0 ;
+ message += fHCAClusteringThreshold ;
+ message += "\n HCA Local Maximum cut = " ;
+ message += fHCALocMaxCut ;
+ message += "\n HCA Logarothmic weight = " ;
+ message += fHCAW0 ;
if(fToUnfold)
message +="\nUnfolding on\n" ;
else
{
// Prints list of RecPoints produced at the current pass of AliEMCALClusterizer
- TObjArray * aPRERecPoints = AliEMCALGetter::GetInstance()->PRERecPoints() ;
- TObjArray * aECRecPoints = AliEMCALGetter::GetInstance()->ECALRecPoints() ;
- TObjArray * aHCRecPoints = AliEMCALGetter::GetInstance()->HCALRecPoints() ;
+ TObjArray * aPRERecPoints = AliEMCALGetter::Instance()->PRERecPoints() ;
+ TObjArray * aECARecPoints = AliEMCALGetter::Instance()->ECARecPoints() ;
+ TObjArray * aHCARecPoints = AliEMCALGetter::Instance()->HCARecPoints() ;
Info("PrintRecPoints", "Clusterization result:") ;
printf("event # %d\n", gAlice->GetEvNumber() ) ;
- printf(" Found %d PRE SHOWER RecPoints, %d EC Rec Points and %d HC Rec Points\n ",
- aPRERecPoints->GetEntriesFast(), aECRecPoints->GetEntriesFast(), aHCRecPoints->GetEntriesFast() ) ;
+ printf(" Found %d PRE SHOWER RecPoints, %d ECA Rec Points and %d HCA Rec Points\n ",
+ aPRERecPoints->GetEntriesFast(), aECARecPoints->GetEntriesFast(), aHCARecPoints->GetEntriesFast() ) ;
fRecPointsInRun += aPRERecPoints->GetEntriesFast() ;
- fRecPointsInRun += aECRecPoints->GetEntriesFast() ;
- fRecPointsInRun += aHCRecPoints->GetEntriesFast() ;
+ fRecPointsInRun += aECARecPoints->GetEntriesFast() ;
+ fRecPointsInRun += aHCARecPoints->GetEntriesFast() ;
if(strstr(option,"all")) {
printf("Clusters in ECAL section\n") ;
printf("Index Ene(GeV) Multi Module phi r theta X Y Z Dispersion Lambda 1 Lambda 2 # of prim Primaries list\n") ;
- for (index = 0 ; index < aECRecPoints->GetEntries() ; index++) {
- AliEMCALTowerRecPoint * rp = dynamic_cast<AliEMCALTowerRecPoint * >(aECRecPoints->At(index)) ;
+ for (index = 0 ; index < aECARecPoints->GetEntries() ; index++) {
+ AliEMCALTowerRecPoint * rp = dynamic_cast<AliEMCALTowerRecPoint * >(aECARecPoints->At(index)) ;
TVector3 globalpos;
rp->GetGlobalPosition(globalpos);
TVector3 localpos;
printf("Clusters in HCAL section\n") ;
printf("Index Ene(GeV) Multi Module phi r theta X Y Z Dispersion Lambda 1 Lambda 2 # of prim Primaries list\n") ;
- for (index = 0 ; index < aHCRecPoints->GetEntries() ; index++) {
- AliEMCALTowerRecPoint * rp = dynamic_cast<AliEMCALTowerRecPoint * >(aHCRecPoints->At(index)) ;
+ for (index = 0 ; index < aHCARecPoints->GetEntries() ; index++) {
+ AliEMCALTowerRecPoint * rp = dynamic_cast<AliEMCALTowerRecPoint * >(aHCARecPoints->At(index)) ;
TVector3 globalpos;
rp->GetGlobalPosition(globalpos);
TVector3 localpos;
public:
AliEMCALClusterizerv1() ;
- AliEMCALClusterizerv1(const char * headerFile, const char * name = "Default", const Bool_t toSplit=kFALSE);
+ AliEMCALClusterizerv1(const TString alirunFileNameFile, const TString eventFolderName = AliConfig::fgkDefaultEventFolderName);
virtual ~AliEMCALClusterizerv1() ;
virtual Int_t AreNeighbours(AliEMCALDigit * d1, AliEMCALDigit * d2)const ;
virtual Float_t Calibrate(Int_t amp, Int_t where)const ; // Tranforms Amp to energy
virtual void GetNumberOfClustersFound(int * numb )const{ numb[0] = fNumberOfPREClusters ;
- numb[1] = fNumberOfECClusters ;
- numb[2] = fNumberOfHCClusters ; }
+ numb[1] = fNumberOfECAClusters ;
+ numb[2] = fNumberOfHCAClusters ; }
virtual Float_t GetPREClusteringThreshold()const{ return fPREClusteringThreshold; }
- virtual Float_t GetECClusteringThreshold()const{ return fECClusteringThreshold;}
- virtual Float_t GetHCClusteringThreshold()const{ return fHCClusteringThreshold;}
+ virtual Float_t GetECAClusteringThreshold()const{ return fECAClusteringThreshold;}
+ virtual Float_t GetHCAClusteringThreshold()const{ return fHCAClusteringThreshold;}
virtual Float_t GetPRELocalMaxCut()const { return fPRELocMaxCut;}
virtual Float_t GetPREShoLogWeight()const { return fPREW0;}
- virtual Float_t GetECLocalMaxCut()const { return fECLocMaxCut;}
- virtual Float_t GetECLogWeight()const { return fECW0;}
- virtual Float_t GetHCLocalMaxCut()const { return fHCLocMaxCut;}
- virtual Float_t GetHCLogWeight()const { return fHCW0;}
+ virtual Float_t GetECALocalMaxCut()const { return fECALocMaxCut;}
+ virtual Float_t GetECALogWeight()const { return fECAW0;}
+ virtual Float_t GetHCALocalMaxCut()const { return fHCALocMaxCut;}
+ virtual Float_t GetHCALogWeight()const { return fHCAW0;}
virtual Float_t GetTimeGate() const { return fTimeGate ; }
virtual const char * GetRecPointsBranch() const{ return GetName() ;}
virtual void Print(Option_t * option)const ;
- virtual void SetECClusteringThreshold(Float_t cluth) { fECClusteringThreshold = cluth ; }
- virtual void SetECLocalMaxCut(Float_t cut) { fECLocMaxCut = cut ; }
- virtual void SetECLogWeight(Float_t w) { fECW0 = w ; }
- virtual void SetHCClusteringThreshold(Float_t cluth) { fHCClusteringThreshold = cluth ; }
- virtual void SetHCLocalMaxCut(Float_t cut) { fHCLocMaxCut = cut ; }
- virtual void SetHCLogWeight(Float_t w) { fHCW0 = w ; }
- virtual void SetTimeGate(Float_t gate) { fTimeGate = gate ;}
- virtual void SetPREClusteringThreshold(Float_t cluth) { fPREClusteringThreshold = cluth ; }
- virtual void SetPRELocalMaxCut(Float_t cut) { fPRELocMaxCut = cut ; }
- virtual void SetPRELogWeight(Float_t w) { fPREW0 = w ; }
- virtual void SetUnfolding(Bool_t toUnfold = kTRUE ) {fToUnfold = toUnfold ;}
+ virtual void SetECAClusteringThreshold(Float_t cluth) { fECAClusteringThreshold = cluth ; }
+ virtual void SetECALocalMaxCut(Float_t cut) { fECALocMaxCut = cut ; }
+ virtual void SetECALogWeight(Float_t w) { fECAW0 = w ; }
+ virtual void SetHCAClusteringThreshold(Float_t cluth) { fHCAClusteringThreshold = cluth ; }
+ virtual void SetHCALocalMaxCut(Float_t cut) { fHCALocMaxCut = cut ; }
+ virtual void SetHCALogWeight(Float_t w) { fHCAW0 = w ; }
+ virtual void SetTimeGate(Float_t gate) { fTimeGate = gate ;}
+ virtual void SetPREClusteringThreshold(Float_t cluth) { fPREClusteringThreshold = cluth ; }
+ virtual void SetPRELocalMaxCut(Float_t cut) { fPRELocMaxCut = cut ; }
+ virtual void SetPRELogWeight(Float_t w) { fPREW0 = w ; }
+ virtual void SetUnfolding(Bool_t toUnfold = kTRUE ) {fToUnfold = toUnfold ;}
static Double_t ShowerShape(Double_t r) ; // Shape of EM shower used in unfolding;
//class member function (not object member function)
static void UnfoldingChiSquare(Int_t & nPar, Double_t * Grad, Double_t & fret, Double_t * x, Int_t iflag) ;
// Chi^2 of the fit. Should be static to be passes to MINUIT
+ void Unload() ;
virtual const char * Version() const { return "clu-v1" ; }
protected:
Bool_t fToUnfold ; // To perform unfolding
Int_t fNumberOfPREClusters ; // number of clusters found in PRE section
- Int_t fNumberOfECClusters ; // number of clusters found in EC section
- Int_t fNumberOfHCClusters ; // number of clusters found in HC section
+ Int_t fNumberOfECAClusters ; // number of clusters found in EC section
+ Int_t fNumberOfHCAClusters ; // number of clusters found in HC section
//Calibration parameters... to be replaced by database
Float_t fADCchannelPRE ; // width of one ADC channel for PRE section (GeV)
Float_t fADCpedestalPRE ; // pedestal of ADC for PRE section (GeV)
- Float_t fADCchannelEC ; // width of one ADC channel for EC section (GeV)
- Float_t fADCpedestalEC ; // pedestal of ADC for EC section (GeV)
- Float_t fADCchannelHC ; // width of one ADC channel for HC section (GeV)
- Float_t fADCpedestalHC ; // pedestal of ADC for HC section (GeV)
+ Float_t fADCchannelECA ; // width of one ADC channel for EC section (GeV)
+ Float_t fADCpedestalECA ; // pedestal of ADC for EC section (GeV)
+ Float_t fADCchannelHCA ; // width of one ADC channel for HC section (GeV)
+ Float_t fADCpedestalHCA ; // pedestal of ADC for HC section (GeV)
- Float_t fECClusteringThreshold ; // minimum energy to include a EC digit in a cluster
- Float_t fHCClusteringThreshold ; // minimum energy to include a HC digit in a cluster
- Float_t fPREClusteringThreshold ; // minimum energy to include a PRE digit in a cluster
- Float_t fECLocMaxCut ; // minimum energy difference to distinguish local maxima in a cluster
- Float_t fECW0 ; // logarithmic weight for the cluster center of gravity calculation
- Float_t fHCLocMaxCut ; // minimum energy difference to distinguish local maxima in a cluster
- Float_t fHCW0 ; // logarithmic weight for the cluster center of gravity calculation
- Float_t fPRELocMaxCut ; // minimum energy difference to distinguish local maxima in a CPV cluster
- Float_t fPREW0 ; // logarithmic weight for the CPV cluster center of gravity calculation
- Int_t fRecPointsInRun ; //! Total number of recpoints in one run
- Float_t fTimeGate ; // Maximum time difference between the digits in ont EMC cluster
+ Float_t fECAClusteringThreshold ; // minimum energy to include a EC digit in a cluster
+ Float_t fHCAClusteringThreshold ; // minimum energy to include a HC digit in a cluster
+ Float_t fPREClusteringThreshold ; // minimum energy to include a PRE digit in a cluster
+ Float_t fECALocMaxCut ; // minimum energy difference to distinguish local maxima in a cluster
+ Float_t fECAW0 ; // logarithmic weight for the cluster center of gravity calculation
+ Float_t fHCALocMaxCut ; // minimum energy difference to distinguish local maxima in a cluster
+ Float_t fHCAW0 ; // logarithmic weight for the cluster center of gravity calculation
+ Float_t fPRELocMaxCut ; // minimum energy difference to distinguish local maxima in a CPV cluster
+ Float_t fPREW0 ; // logarithmic weight for the CPV cluster center of gravity calculation
+ Int_t fRecPointsInRun ; //! Total number of recpoints in one run
+ Float_t fTimeGate ; // Maximum time difference between the digits in ont EMC cluster
ClassDef(AliEMCALClusterizerv1,2) // Clusterizer implementation version 1
{
// default ctor
- fIndexInList = 0 ;
+ fIndexInList = -1 ;
fNprimary = 0 ;
- fNMaxPrimary = 0 ;
- fNiparent = 0 ;
-
- fNMaxiparent = 0;
+ fNMaxPrimary = 5 ;
+ fNiparent = 0 ;
+ fNMaxiparent = 5;
fPrimary = 0 ;
fIparent = 0 ;
fMaxIter = 0;
}
//____________________________________________________________________________
-const Float_t AliEMCALDigit::GetEta() const
+Float_t AliEMCALDigit::GetEta() const
{
Float_t eta=-10., phi=-10.;
Int_t id = GetId();
- const AliEMCALGeometry *g = AliEMCALGetter::GetInstance()->EMCALGeometry();
+ const AliEMCALGeometry *g = AliEMCALGetter::Instance()->EMCALGeometry();
g->EtaPhiFromIndex(id,eta,phi);
return eta ;
}
//____________________________________________________________________________
-const Float_t AliEMCALDigit::GetPhi() const
+Float_t AliEMCALDigit::GetPhi() const
{
Float_t eta=-10., phi=-10.;
Int_t id = GetId();
- const AliEMCALGeometry *g = AliEMCALGetter::GetInstance()->EMCALGeometry();
+ const AliEMCALGeometry *g = AliEMCALGetter::Instance()->EMCALGeometry();
g->EtaPhiFromIndex(id,eta,phi);
return phi ;
}
AliEMCALDigit& operator*(Float_t factor) ;
Int_t Compare(const TObject * obj) const ;
- const Float_t GetEta() const ;
- Int_t GetNprimary() const {
- // returns the number of primaries
- return fNprimary ; }
+ Float_t GetEta() const ;
+ Int_t GetNprimary() const { return fNprimary ; }
Int_t GetPrimary(Int_t index) const ;
Int_t GetNiparent() const {return fNiparent;}
Int_t GetIparent(Int_t index) const ;
- const Float_t GetPhi() const;
+ Float_t GetPhi() const;
Float_t GetTime(void) const {return fTime ;}
- Bool_t IsSortable() const {
- // says that AliEMCALDigits are sortable (needed for Sort method
- return kTRUE ; }
- void SetAmp(Int_t amp) {
- // sets the amplitude data member
- fAmp= amp ; }
- void SetId(Int_t id) {fId = id ;}
- void SetTime(Float_t time) {fTime = time ;}
- void ShiftPrimary(Int_t shift); // shift to semarate different TreeK in merging
+ Bool_t IsSortable() const { return kTRUE ; }
+ void SetAmp(Int_t amp) { fAmp= amp ; }
+ void SetId(Int_t id) {fId = id ;}
+ void SetTime(Float_t time) {fTime = time ;}
+ void ShiftPrimary(Int_t shift); // shift to semarate different TreeK in merging
private:
+
Int_t fNprimary ; // Number of primaries
Int_t fNMaxPrimary ; // Max Number of primaries
Int_t *fPrimary ; //[fNMaxPrimary] Array of primaries
//____________________________________________________________________________
- AliEMCALDigitizer::AliEMCALDigitizer()
+ AliEMCALDigitizer::AliEMCALDigitizer():AliDigitizer("",""),
+ fInput(0),
+ fInputFileNames(0x0),
+ fEventNames(0x0)
{
// ctor
- //InitParameters() ;
+ InitParameters() ;
fDefaultInit = kTRUE ;
fManager = 0 ; // We work in the standalong mode
-
+ fEventFolderName = "" ;
}
//____________________________________________________________________________
-AliEMCALDigitizer::AliEMCALDigitizer(const char *headerFile, const char *name, const Bool_t toSplit)
+AliEMCALDigitizer::AliEMCALDigitizer(const TString alirunFileName, const TString eventFolderName):
+ AliDigitizer("EMCAL"+AliConfig::fgkDigitizerTaskName, alirunFileName),
+ fInputFileNames(0), fEventNames(0), fEventFolderName(eventFolderName)
{
// ctor
- SetTitle(headerFile) ;
- SetName(name) ;
- fManager = 0 ; // We work in the standalong mode
- fSplitFile= 0 ;
- fToSplit = toSplit ;
- Init() ;
InitParameters() ;
+ Init() ;
fDefaultInit = kFALSE ;
+ fManager = 0 ; // We work in the standalong mode
}
//____________________________________________________________________________
-AliEMCALDigitizer::AliEMCALDigitizer(AliRunDigitizer * ard):AliDigitizer(ard)
+AliEMCALDigitizer::AliEMCALDigitizer(const AliEMCALDigitizer & d)
+{
+ // copyy ctor
+
+ SetName(d.GetName()) ;
+ SetTitle(d.GetTitle()) ;
+ fDigitThreshold = d.fDigitThreshold ;
+ fMeanPhotonElectron = d.fMeanPhotonElectron ;
+ fPedestal = d.fPedestal ;
+ fSlope = d.fSlope ;
+ fPinNoise = d.fPinNoise ;
+ fTimeResolution = d.fTimeResolution ;
+ fTimeThreshold = d.fTimeThreshold ;
+ fTimeSignalLength = d.fTimeSignalLength ;
+ fADCchannelEC = d.fADCchannelEC ;
+ fADCpedestalEC = d.fADCpedestalEC ;
+ fNADCEC = d.fNADCEC ;
+ fADCchannelHC = d.fADCchannelHC ;
+ fADCpedestalHC = d.fADCpedestalHC ;
+ fNADCHC = d.fNADCHC ;
+ fADCchannelPRE = d.fADCchannelPRE ;
+ fADCpedestalPRE = d.fADCpedestalPRE ;
+ fNADCPRE = d.fNADCPRE ;
+ fEventFolderName = d.fEventFolderName;
+ }
+
+//____________________________________________________________________________
+AliEMCALDigitizer::AliEMCALDigitizer(AliRunDigitizer * rd):
+ AliDigitizer(rd,"EMCAL"+AliConfig::fgkDigitizerTaskName),
+ fEventFolderName(0)
{
// ctor
- SetTitle(ard->GetInputFileName(0,0)) ;
+ fManager = rd ;
+ SetName(fManager->GetInputFolderName(0)) ;
+ // take title as name of stream 0
+ SetTitle(dynamic_cast<AliStream*>(fManager->GetInputStream(0))->GetFileName(0));
InitParameters() ;
+ Init() ;
fDefaultInit = kFALSE ;
- fSplitFile = 0 ;
-
- if (ard->GetOutputFile()) {
- SetName(ard->GetOutputFile().Data());
- fToSplit = kTRUE ;
- } else {
- SetName("Default") ;
- fToSplit = kFALSE ;
- }
}
//____________________________________________________________________________
AliEMCALDigitizer::~AliEMCALDigitizer()
{
// dtor
+ delete [] fInputFileNames ;
+ delete [] fEventNames ;
- fSplitFile = 0 ;
}
//____________________________________________________________________________
// helps to avoid scanning over the list of digits to add
// contribution of any new SDigit.
- AliEMCALGetter * gime = AliEMCALGetter::GetInstance() ;
- TClonesArray * digits = gime->Digits(GetName()) ;
-
+ AliEMCALGetter * gime = AliEMCALGetter::Instance(GetTitle(), fEventFolderName) ;
+ TClonesArray * digits = gime->Digits() ;
digits->Clear() ;
const AliEMCALGeometry *geom = gime->EMCALGeometry() ;
nEMC = 3*geom->GetNPhi()*geom->GetNZ(); //max number of digits possible (Preshower, ECAL, HCAL)
else
nEMC = 2*geom->GetNPhi()*geom->GetNZ(); //max number of digits possible (Preshower, ECAL)
-
- Int_t absID ;
- TString name = geom->GetName() ;
+
+ Int_t absID ;
- // get first the sdigitizer from the tasks list (must have same name as the digitizer)
- const AliEMCALSDigitizer * sDigitizer = gime->SDigitizer(GetName());
- if ( !sDigitizer) {
- Fatal("Digitize", "SDigitizer with name %s not found", GetName() );
- }
+ digits->Expand(nEMC) ;
-// loop through the sdigits posted to the White Board and add them to the noise
- TCollection * folderslist = gime->SDigitsFolder()->GetListOfFolders() ;
- TIter next(folderslist) ;
- TFolder * folder = 0 ;
- TClonesArray * sdigits = 0 ;
- Int_t input = 0 ;
- TObjArray * sdigArray = new TObjArray(2) ;
- while ( (folder = (TFolder*)next()) ) {
- if ( (sdigits = (TClonesArray*)folder->FindObject(GetName()) ) ) {
- TString fileName(folder->GetName()) ;
- fileName.ReplaceAll("_","/") ;
- if (gDebug)
- Info("Digitize", "Adding SDigits %s from %s", GetName(), fileName.Data()) ;
- sdigArray->AddAt(sdigits, input) ;
- input++ ;
- }
+ // get first the sdigitizer from the tasks list (must have same name as the digitizer)
+ if ( !gime->SDigitizer() )
+ gime->LoadSDigitizer();
+ AliEMCALSDigitizer * sDigitizer = gime->SDigitizer();
+
+ if ( !sDigitizer )
+ Fatal("Digitize", "SDigitizer with name %s %s not found", fEventFolderName.Data(), GetTitle() ) ;
+
+ //take all the inputs to add together and load the SDigits
+ TObjArray * sdigArray = new TObjArray(fInput) ;
+ sdigArray->AddAt(gime->SDigits(), 0) ;
+ Int_t i ;
+ for(i = 1 ; i < fInput ; i++){
+ TString tempo(fEventNames[i]) ;
+ tempo += i ;
+ AliEMCALGetter * gime = AliEMCALGetter::Instance(fInputFileNames[i], tempo) ;
+ gime->Event(event,"S");
+ sdigArray->AddAt(gime->SDigits(), i) ;
}
-
+
//Find the first tower with signal
Int_t nextSig = nEMC + 1 ;
- Int_t i;
- for(i=0; i<input; i++){
- sdigits = (TClonesArray *)sdigArray->At(i) ;
+ TClonesArray * sdigits ;
+ for(i = 0 ; i < fInput ; i++){
+ sdigits = dynamic_cast<TClonesArray *>(sdigArray->At(i)) ;
if ( !sdigits->GetEntriesFast() )
continue ;
- Int_t curNext = ((AliEMCALDigit *)sdigits->At(0))->GetId() ;
+ Int_t curNext = dynamic_cast<AliEMCALDigit *>(sdigits->At(0))->GetId() ;
if(curNext < nextSig)
nextSig = curNext ;
}
- TArrayI index(input) ;
+ TArrayI index(fInput) ;
index.Reset() ; //Set all indexes to zero
AliEMCALDigit * digit ;
//Put Noise contribution
for(absID = 1; absID <= nEMC; absID++){
- Float_t amp = 0 ;
- // Float_t noise = TMath::Abs(gRandom->Gaus(0., fPinNoise));
- //new((*digits)[absID-1]) AliEMCALDigit( -1, -1, absID, sDigitizer->Digitize(noise), TimeOfNoise() ) ;
+ Float_t amp = 0 ;
// amplitude set to zero, noise will be added later
new((*digits)[absID-1]) AliEMCALDigit( -1, -1, absID, 0, TimeOfNoise() ) ;
//look if we have to add signal?
- digit = (AliEMCALDigit *) digits->At(absID-1) ;
+ digit = dynamic_cast<AliEMCALDigit *>(digits->At(absID-1)) ;
+
if(absID==nextSig){
//Add SDigits from all inputs
ticks->Clear() ;
Int_t contrib = 0 ;
Float_t a = digit->GetAmp() ;
Float_t b = TMath::Abs( a /fTimeSignalLength) ;
- //Mark the beginnign of the signal
+ //Mark the beginning of the signal
new((*ticks)[contrib++]) AliEMCALTick(digit->GetTime(),0, b);
//Mark the end of the ignal
new((*ticks)[contrib++]) AliEMCALTick(digit->GetTime()+fTimeSignalLength, -a, -b);
- // loop over input
- for(i = 0; i< input ; i++){ //loop over (possible) merge sources
- if(((TClonesArray *)sdigArray->At(i))->GetEntriesFast() > index[i] )
- curSDigit = (AliEMCALDigit*)((TClonesArray *)sdigArray->At(i))->At(index[i]) ;
+ // loop over input
+ for(i = 0; i< fInput ; i++){ //loop over (possible) merge sources
+ if(dynamic_cast<TClonesArray *>(sdigArray->At(i))->GetEntriesFast() > index[i] )
+ curSDigit = dynamic_cast<AliEMCALDigit*>(dynamic_cast<TClonesArray *>(sdigArray->At(i))->At(index[i])) ;
else
curSDigit = 0 ;
//May be several digits will contribute from the same input
*digit = *digit + *curSDigit ; //add energies
index[i]++ ;
- if(((TClonesArray *)sdigArray->At(i))->GetEntriesFast() > index[i] )
- curSDigit = (AliEMCALDigit*)((TClonesArray *)sdigArray->At(i))->At(index[i]) ;
+ if( dynamic_cast<TClonesArray *>(sdigArray->At(i))->GetEntriesFast() > index[i] )
+ curSDigit = dynamic_cast<AliEMCALDigit*>(dynamic_cast<TClonesArray *>(sdigArray->At(i))->At(index[i])) ;
else
curSDigit = 0 ;
}
}
// add fluctuations for photo-electron creation
amp = sDigitizer->Calibrate(digit->GetAmp()) ; // GeV
- if (gDebug==1)
- Info("Digitize", "id = %d BEFORE amp = %f\n", digit->GetId(),amp) ;
amp *= static_cast<Float_t>(gRandom->Poisson(fMeanPhotonElectron)) / static_cast<Float_t>(fMeanPhotonElectron) ;
- if (gDebug==1)
- Info("Digitize", "After fluctuation amp = %f\n", amp) ;
+
//calculate and set time
Float_t time = FrontEdgeTime(ticks) ;
digit->SetTime(time) ;
//Find next signal module
nextSig = nEMC + 1 ;
- for(i=0; i<input; i++){
- sdigits = ((TClonesArray *)sdigArray->At(i)) ;
+ for(i = 0 ; i < fInput ; i++){
+ sdigits = dynamic_cast<TClonesArray *>(sdigArray->At(i)) ;
Int_t curNext = nextSig ;
if(sdigits->GetEntriesFast() > index[i] ){
- curNext = ((AliEMCALDigit *) sdigits->At(index[i]))->GetId() ;
-
+ curNext = dynamic_cast<AliEMCALDigit *>(sdigits->At(index[i]))->GetId() ;
}
if(curNext < nextSig) nextSig = curNext ;
}
}
// add the noise now
- if (geom->IsInECAL(digit->GetId()))
+ if (geom->IsInECA(digit->GetId()))
amp += TMath::Abs(gRandom->Gaus(0., fPinNoise)) ;
else if (geom->IsInPRE(digit->GetId()))
amp += TMath::Abs(gRandom->Gaus(0., fPinNoise/100.)) ; // arbitrarely divide by 100, assuming that the gain of APD will be higher
- else if (geom->IsInHCAL(digit->GetId()))
+ else if (geom->IsInHCA(digit->GetId()))
amp += TMath::Abs(gRandom->Gaus(0., fPinNoise/10.)) ; // arbitrarely divide by 10, assuming that the gain of APD will be higher
- if (gDebug==1)
- Info("Digitize", "After noise amp = %f \n", amp) ;
digit->SetAmp(sDigitizer->Digitize(amp)) ;
}
delete sdigArray ; //We should not delete its contents
//remove digits below thresholds
- for(absID = 0; absID < nEMC; absID++){
- digit = dynamic_cast<AliEMCALDigit*>( digits->At(absID) ) ;
+ for(i = 0 ; i < nEMC ; i++){
+ digit = dynamic_cast<AliEMCALDigit*>( digits->At(i) ) ;
Float_t threshold = 0 ;
- if (geom->IsInECAL(digit->GetId()))
+ if (geom->IsInECA(digit->GetId()))
threshold = fDigitThreshold ;
else if (geom->IsInPRE(digit->GetId()))
threshold = fDigitThreshold / 100. ; // arbitrary see before when noise is added
- else if (geom->IsInHCAL(digit->GetId()))
+ else if (geom->IsInHCA(digit->GetId()))
threshold = fDigitThreshold / 10. ; // arbitrary see before when noise is added
- if(sDigitizer->Calibrate( digit->GetAmp() ) <= threshold)
- digits->RemoveAt(absID) ;
- else {
- if (gDebug == 1)
- Info("Digitize", "id = %d, amp = %f, noise = %f", absID, sDigitizer->Calibrate(digit->GetAmp()), fPinNoise) ;
+ if(sDigitizer->Calibrate( digit->GetAmp() ) < threshold)
+ digits->RemoveAt(i) ;
+ else
digit->SetTime(gRandom->Gaus(digit->GetTime(),fTimeResolution) ) ;
- }
}
digits->Compress() ;
Int_t ndigits = digits->GetEntriesFast() ;
- // digits->Expand(ndigits) ;
+ digits->Expand(ndigits) ;
//Set indexes in list of digits
for (i = 0 ; i < ndigits ; i++) {
Int_t AliEMCALDigitizer::DigitizeEnergy(Float_t energy, Int_t absId)
{
Int_t channel = -999;
- AliEMCALGeometry * geom = AliEMCALGetter::GetInstance()->EMCALGeometry() ;
+ AliEMCALGeometry * geom = AliEMCALGetter::Instance()->EMCALGeometry() ;
if(geom->IsInPRE(absId)){ //digitize as PRE section
channel = static_cast<Int_t>(TMath::Ceil( (energy + fADCpedestalPRE)/fADCchannelPRE )) ;
if(channel > fNADCPRE )
channel = fNADCPRE ;
}
- else if(geom->IsInECAL(absId)){ //digitize as ECAL section
+ else if(geom->IsInECA(absId)){ //digitize as ECAL section
channel = static_cast<Int_t> (TMath::Ceil( (energy + fADCpedestalEC)/fADCchannelEC )) ;
if(channel > fNADCEC )
channel = fNADCEC ;
}
- else if(geom->IsInHCAL(absId)){ //digitize as HCAL section
+ else if(geom->IsInHCA(absId)){ //digitize as HCAL section
channel = static_cast<Int_t> (TMath::Ceil( (energy + fADCpedestalHC)/fADCchannelHC )) ;
if(channel > fNADCHC )
channel = fNADCHC ;
{
// Managing method
- if(strcmp(GetName(), "") == 0 )
- Init() ;
+ if (!fInit) { // to prevent overwrite existing file
+ Error( "Exec", "Give a version name different from %s", fEventFolderName.Data() ) ;
+ return ;
+ }
+
if (strstr(option,"print")) {
- Print("");
+ Print();
return ;
}
if(strstr(option,"tim"))
gBenchmark->Start("EMCALDigitizer");
- AliEMCALGetter * gime = AliEMCALGetter::GetInstance() ;
+ if (fManager)
+ fInput = fManager->GetNinputs() ;
- Int_t nevents ;
+ AliEMCALGetter * gime = AliEMCALGetter::Instance() ;
- TTree * treeD ;
-
- if(fManager){
- treeD = fManager->GetTreeD() ;
- nevents = 1 ; // Will process only one event
-
- //Check, if this branch already exits
- if (treeD) {
- TObjArray * lob = (TObjArray*)treeD->GetListOfBranches() ;
- TIter next(lob) ;
- TBranch * branch = 0 ;
- Bool_t emcalfound = kFALSE, digitizerfound = kFALSE ;
-
- while ( (branch = (TBranch*)next()) && (!emcalfound || !digitizerfound) ) {
- if ( (strcmp(branch->GetName(), "EMCAL")==0) &&
- (strcmp(branch->GetTitle(), GetName())==0) )
- emcalfound = kTRUE ;
-
- else if ( (strcmp(branch->GetName(), "AliEMCALDigitizer")==0) &&
- (strcmp(branch->GetTitle(), GetName())==0) )
- digitizerfound = kTRUE ;
- }
-
- if ( emcalfound ) {
- Error( "Exec", "Digits branch with name %s already exits", GetName() ) ;
- return ;
- }
- if ( digitizerfound ) {
- Error( "Exec", "Digitizer branch with name %s already exit", GetName() ) ;
- return ;
- }
- }
- }
- else { //EMCAL standalone
- if(gime->BranchExists("Digits") )
- return ;
- nevents=gime->MaxEvent() ;
- }
+ Int_t nevents = gime->MaxEvent() ;;
Int_t ievent ;
for(ievent = 0; ievent < nevents; ievent++){
- if(fManager){
-
- Int_t input ;
- for(input = 0 ; input < fManager->GetNinputs(); input ++){
- TTree * treeS = fManager->GetInputTreeS(input) ;
- if(!treeS){
- Error( "Exec", "No Input") ;
- return ;
- }
- gime->ReadTreeS(treeS,input) ;
- }
+ gime->Event(ievent,"S") ;
- }
- else
- gime->Event(ievent,"S") ;
-
Digitize(ievent) ; //Add prepared SDigits to digits and add the noise
-
+
WriteDigits(ievent) ;
-
+
if(strstr(option,"deb"))
PrintDigits(option);
-
+
//increment the total number of Digits per run
fDigitsInRun += gime->Digits()->GetEntriesFast() ;
}
gBenchmark->Stop("EMCALDigitizer");
Info("Exec", "took %f seconds for Digitizing %f seconds per event",
gBenchmark->GetCpuTime("EMCALDigitizer"), gBenchmark->GetCpuTime("EMCALDigitizer")/nevents ) ;
- }
-
+ }
}
//____________________________________________________________________________
Float_t AliEMCALDigitizer::FrontEdgeTime(TClonesArray * ticks)
-{ //
+{
+ // Returns the shortest time among all time ticks
+
ticks->Sort() ; //Sort in accordance with times of ticks
TIter it(ticks) ;
AliEMCALTick * ctick = (AliEMCALTick *) it.Next() ;
Bool_t AliEMCALDigitizer::Init()
{
// Makes all memory allocations
-
- if( strcmp(GetTitle(), "") == 0 )
- SetTitle("galice.root") ;
-
- AliEMCALGetter * gime = AliEMCALGetter::GetInstance(GetTitle(), GetName(), fToSplit) ;
+ fInit = kTRUE ;
+ AliEMCALGetter * gime = AliEMCALGetter::Instance(GetTitle(), fEventFolderName) ;
if ( gime == 0 ) {
- Error("Init", "Could not obtain the Getter object !" ) ;
+ Error("Init", "Could not obtain the Getter object for file %s and event %s !", GetTitle(), fEventFolderName.Data()) ;
return kFALSE;
}
- //const AliEMCALGeometry * geom = gime->EMCALGeometry() ;
+ TString opt("Digits") ;
+ if(gime->VersionExists(opt) ) {
+ Error( "Init", "Give a version name different from %s", fEventFolderName.Data() ) ;
+ fInit = kFALSE ;
+ }
- //fEmcCrystals = geom->GetNModules() * geom->GetNCristalsInModule() ;
-
- // Post Digits to the white board
- gime->PostDigits(GetName() ) ;
-
// Post Digitizer to the white board
gime->PostDigitizer(this) ;
- fSplitFile = 0 ;
- if(fToSplit){
- // construct the name of the file as /path/EMCAL.SDigits.root
- //First - extract full path if necessary
- TString digitsFileName(GetTitle()) ;
- Ssiz_t islash = digitsFileName.Last('/') ;
- if(islash<digitsFileName.Length())
- digitsFileName.Remove(islash+1,digitsFileName.Length()) ;
- else
- digitsFileName="" ;
- // Next - append the file name
- digitsFileName+="EMCAL.Digits." ;
- if((strcmp(GetName(),"Default")!=0)&&(strcmp(GetName(),"")!=0)){
- digitsFileName+=GetName() ;
- digitsFileName+="." ;
- }
- digitsFileName+="root" ;
- // Finally - check if the file already opened or open the file
- fSplitFile = static_cast<TFile*>(gROOT->GetFile(digitsFileName.Data()));
- if(!fSplitFile)
- fSplitFile = TFile::Open(digitsFileName.Data(),"update") ;
+ if(fManager)
+ fInput = fManager->GetNinputs() ;
+ else
+ fInput = 1 ;
+
+ fInputFileNames = new TString[fInput] ;
+ fEventNames = new TString[fInput] ;
+ fInputFileNames[0] = GetTitle() ;
+ fEventNames[0] = fEventFolderName.Data() ;
+ Int_t index ;
+ for (index = 1 ; index < fInput ; index++) {
+ fInputFileNames[index] = dynamic_cast<AliStream*>(fManager->GetInputStream(index))->GetFileName(0);
+ TString tempo = fManager->GetInputFolderName(index) ;
+ fEventNames[index] = tempo.Remove(tempo.Length()-1) ; // strip of the stream number added bt fManager
}
- //Mark that we will use current header file
- if(!fManager){
- gime->PostSDigits(GetName(),GetTitle()) ;
- gime->PostSDigitizer(GetName(),GetTitle()) ;
- }
- return kTRUE ;
+ //to prevent cleaning of this object while GetEvent is called
+ gime->EmcalLoader()->GetDigitsDataLoader()->GetBaseTaskLoader()->SetDoNotReload(kTRUE);
+
+ return fInit ;
}
//____________________________________________________________________________
void AliEMCALDigitizer::InitParameters()
{
fMeanPhotonElectron = 1250 ; // electrons per GeV
-
- Warning("InitParameters", "No noise added\n") ;
- fPinNoise = 0. ; // 0.001 ; // noise equivalent GeV (random choice)
+ fPinNoise = 0.001 ; // noise equivalent GeV (random choice)
+ if (fPinNoise == 0. )
+ Warning("InitParameters", "No noise added\n") ;
fDigitThreshold = fPinNoise * 3; //2 sigma
fTimeResolution = 0.5e-9 ;
fTimeSignalLength = 1.0e-9 ;
}
//__________________________________________________________________
-void AliEMCALDigitizer::MixWith(char* headerFile)
+void AliEMCALDigitizer::MixWith(const TString alirunFileName, const TString eventFolderName)
{
// Allows to produce digits by superimposing background and signal event.
// It is assumed, that headers file with SIGNAL events is opened in
Error("MixWith", "Cannot use this method under AliRunDigitizer") ;
return ;
}
-
- // check if the specified SDigits do not already exist on the White Board:
- // //Folders/RunMC/Event/Data/EMCAL/SDigits/headerFile/sdigitsname
-
- AliEMCALGetter * gime = AliEMCALGetter::GetInstance() ;
- TString path = gime->SDigitsFolder()->GetName() ;
-
- // before it was ???? "Folders/RunMC/Event/Data/EMCAL/SDigits" ;
- path += headerFile ;
- path += "/" ;
- path += GetName() ;
- if ( gROOT->FindObjectAny(path.Data()) ) {
- Error("MixWith", "Entry already exists, do not add" ) ;
- return;
+ // looking for file which contains AliRun
+ if (gSystem->AccessPathName(alirunFileName)) {// file does not exist
+ Error("MixWith", "File %s does not exist!", alirunFileName.Data()) ;
+ return ;
}
-
- gime->PostSDigits(GetName(),headerFile) ;
-
- // check if the requested file is already open or exist and if SDigits Branch exist
- TFile * file = (TFile*)gROOT->FindObject(headerFile);
- if ( !file ) {
- file = new TFile(headerFile, "READ") ;
- if (!file) {
- Error("MixWith", "File %s does not exist!", headerFile) ;
- return ;
+ // looking for the file which contains SDigits
+ AliEMCALGetter * gime = AliEMCALGetter::Instance() ;
+ TString fileName( gime->GetSDigitsFileName() ) ;
+ if ( eventFolderName != AliConfig::fgkDefaultEventFolderName) // only if not the default folder name
+ fileName = fileName.ReplaceAll(".root", "") + "_" + eventFolderName + ".root" ;
+ if ( (gSystem->AccessPathName(fileName)) ) {
+ Error("MixWith", "The file %s does not exist!", fileName.Data()) ;
+ return ;
}
- }
-
-}
-
+ // need to increase the arrays
+ TString tempo = fInputFileNames[fInput-1] ;
+ delete [] fInputFileNames ;
+ fInputFileNames = new TString[fInput+1] ;
+ fInputFileNames[fInput-1] = tempo ;
+
+ tempo = fEventNames[fInput-1] ;
+ delete [] fEventNames ;
+ fEventNames = new TString[fInput+1] ;
+ fEventNames[fInput-1] = tempo ;
+
+ fInputFileNames[fInput] = alirunFileName ;
+ fEventNames[fInput] = eventFolderName ;
+ fInput++ ;
+}
+
//__________________________________________________________________
-void AliEMCALDigitizer::Print(Option_t* option)const {
-
- TString message("\n") ;
-
- if( strcmp(GetName(), "") != 0) {
- message += "------------------- " ;
- message += GetName() ;
- message += " -------------" ;
- const Int_t nStreams = GetNInputStreams() ;
- if (nStreams) {
- Int_t index = 0 ;
- for (index = 0 ; index < nStreams ; index++) {
- message += "\nAdding SDigits " ;
- message += GetName() ;
- message += " from " ;
- message += fManager->GetInputFileName(index, 0) ;
- }
-
- message += "\nWriting digits to " ;
- message += fManager->GetInputFileName(0, 0) ;
- } else {
- message += "\nWriting digits to " ;
- message += GetTitle() ;
- }
- message += "\nWith following parameters: " ;
- message += "\n Electronics noise in EMC (fPinNoise) = " ;
- message += fPinNoise ;
- message += "\n Threshold in EMC (fDigitThreshold) = " ;
- message += fDigitThreshold ;
- message += "\n---------------------------------------------------" ;
+void AliEMCALDigitizer::Print()const
+{
+ // Print Digitizer's parameters
+ Info("Print", "\n------------------- %s -------------", GetName() ) ;
+ if( strcmp(fEventFolderName.Data(), "") != 0 ){
+ printf(" Writing Digits to branch with title %s\n", fEventFolderName.Data()) ;
+
+ Int_t nStreams ;
+ if (fManager)
+ nStreams = GetNInputStreams() ;
+ else
+ nStreams = fInput ;
+
+ Int_t index = 0 ;
+ for (index = 0 ; index < nStreams ; index++) {
+ TString tempo(fEventNames[index]) ;
+ tempo += index ;
+ AliEMCALGetter * gime = AliEMCALGetter::Instance(fInputFileNames[index], tempo) ;
+ TString fileName( gime->GetSDigitsFileName() ) ;
+ if ( fEventNames[index] != AliConfig::fgkDefaultEventFolderName) // only if not the default folder name
+ fileName = fileName.ReplaceAll(".root", "") + "_" + fEventNames[index] + ".root" ;
+ printf ("Adding SDigits from %s %s\n", fInputFileNames[index].Data(), fileName.Data()) ;
+ }
+ AliEMCALGetter * gime = AliEMCALGetter::Instance(GetTitle(), fEventFolderName) ;
+ printf("\nWriting digits to %s", gime->GetDigitsFileName().Data()) ;
+
+ printf("\nWith following parameters:\n") ;
+
+ printf(" Electronics noise in EMC (fPinNoise) = %f\n", fPinNoise) ;
+ printf(" Threshold in EMC (fDigitThreshold) = %f\n", fDigitThreshold) ;
+ printf("---------------------------------------------------\n") ;
}
else
- message += "\nAliEMCALDigitizer not initialized " ;
-
- Info("Print", message.Data() ) ;
+ Info("Print", "AliEMCALDigitizer not initialized") ;
}
//__________________________________________________________________
void AliEMCALDigitizer::PrintDigits(Option_t * option){
- AliEMCALGetter * gime = AliEMCALGetter::GetInstance() ;
- TClonesArray * fDigits = gime->Digits() ;
-
- TString message("\n") ;
- message += " Number of entries in Digits list " ;
- message += fDigits->GetEntriesFast() ;
-
- if(strstr(option,"all")){
-
+ AliEMCALGetter * gime = AliEMCALGetter::Instance(GetTitle(), fEventFolderName) ;
+ TClonesArray * digits = gime->Digits() ;
+
+ Info("PrintDigits", "%d", digits->GetEntriesFast()) ;
+ printf("\nevent %d", gAlice->GetEvNumber()) ;
+ printf("\n Number of entries in Digits list %d", digits->GetEntriesFast() ) ;
+
+ if(strstr(option,"all")){
//loop over digits
AliEMCALDigit * digit;
- message += "\n Id Amplitude Time Index Nprim: Primaries list \n" ;
+ printf("\nEMC digits (with primaries):\n") ;
+ printf("\n Id Amplitude Time Index Nprim: Primaries list \n") ;
Int_t index ;
- char * tempo = new char[8192];
- for (index = 0 ; index < fDigits->GetEntries() ; index++) {
- digit = (AliEMCALDigit * ) fDigits->At(index) ;
- sprintf(tempo, "\n%6d %8d %6.5e %4d %2d : ",
+ for (index = 0 ; index < digits->GetEntries() ; index++) {
+ digit = dynamic_cast<AliEMCALDigit *>(digits->At(index)) ;
+ printf("\n%6d %8d %6.5e %4d %2d : ",
digit->GetId(), digit->GetAmp(), digit->GetTime(), digit->GetIndexInList(), digit->GetNprimary()) ;
- message += tempo ;
Int_t iprimary;
for (iprimary=0; iprimary<digit->GetNprimary(); iprimary++) {
- sprintf(tempo, "%d ",digit->GetPrimary(iprimary+1) ) ;
- message += tempo ;
+ printf("%d ",digit->GetPrimary(iprimary+1) ) ;
}
}
- delete tempo ;
}
- Info("PrintDigits", message.Data() ) ;
}
//__________________________________________________________________
}
+//__________________________________________________________________
+void AliEMCALDigitizer::Unload()
+{
+
+ Int_t i ;
+ for(i = 1 ; i < fInput ; i++){
+ TString tempo(fEventNames[i]) ;
+ tempo += i ;
+ AliEMCALGetter * gime = AliEMCALGetter::Instance(fInputFileNames[i], tempo) ;
+ gime->EmcalLoader()->UnloadSDigits() ;
+ }
+
+ AliEMCALGetter * gime = AliEMCALGetter::Instance(GetTitle(), fEventFolderName) ;
+ gime->EmcalLoader()->UnloadDigits() ;
+}
+
//_________________________________________________________________________________________
void AliEMCALDigitizer::WriteDigits(Int_t event)
{
// and branch "AliEMCALDigitizer", with the same title to keep all the parameters
// and names of files, from which digits are made.
- AliEMCALGetter * gime = AliEMCALGetter::GetInstance() ;
- const TClonesArray * digits = gime->Digits(GetName()) ;
- TTree * treeD ;
-
- if(fManager)
- treeD = fManager->GetTreeD() ;
- else {
- if ((gAlice->TreeD() == 0) || (fSplitFile)) // we should not create TreeD if it is already here
- gAlice->MakeTree("D", fSplitFile); // We overwrite TreeD in split file in the case of second reconstruction
- if(fSplitFile)
- fSplitFile->cd() ;
- treeD = gAlice->TreeD();
- }
-
- // -- create Digits branch
- Int_t bufferSize = 32000 ;
- TBranch * digitsBranch = treeD->Branch("EMCAL",&digits,bufferSize);
- digitsBranch->SetTitle(GetName());
-
- // -- Create Digitizer branch
- Int_t splitlevel = 0 ;
- const AliEMCALDigitizer * d = gime->Digitizer(GetName()) ;
- TBranch * digitizerBranch = treeD->Branch("AliEMCALDigitizer", "AliEMCALDigitizer", &d,bufferSize,splitlevel);
- digitizerBranch->SetTitle(GetName());
-
- digitsBranch->Fill() ;
- digitizerBranch->Fill() ;
- treeD->AutoSave() ;
-
+ AliEMCALGetter * gime = AliEMCALGetter::Instance(GetTitle(), fEventFolderName) ;
+ const TClonesArray * digits = gime->Digits() ;
+ TTree * treeD = gime->TreeD();
+
+ // -- create Digits branch
+ Int_t bufferSize = 32000 ;
+ TBranch * digitsBranch = treeD->Branch("EMCAL",&digits,bufferSize);
+ digitsBranch->SetTitle(fEventFolderName);
+ digitsBranch->Fill() ;
+
+ gime->WriteDigits("OVERWRITE");
+ gime->WriteDigitizer("OVERWRITE");
+
+ Unload() ;
+
}
//
//*-- Author: Sahal Yacoob (LBL)
// based on : AliPHOSDigit
+// July 2003 Yves Schutz : NewIO
//_________________________________________________________________________
class TClonesArray ;
// --- Standard library ---
-#include <stdlib.h>
// --- AliRoot header files ---
#include "AliDigitizer.h"
+#include "AliConfig.h"
class AliEMCALSDigitizer ;
class AliRunDigitizer ;
public:
AliEMCALDigitizer() ; // ctor
- AliEMCALDigitizer(const char *headerFile, const char * sDigitsBranchTitle = "Default", const Bool_t toSplit = kFALSE) ;
- AliEMCALDigitizer(AliRunDigitizer * ard) ;
- AliEMCALDigitizer(const AliEMCALDigitizer & dtizer)
- {( (AliEMCALDigitizer &)dtizer ).Copy(*this) ;}
+ AliEMCALDigitizer(const TString alirunFileNameFile, const TString eventFolderName = AliConfig::fgkDefaultEventFolderName) ;
+ AliEMCALDigitizer(const AliEMCALDigitizer & dtizer) ;
+ AliEMCALDigitizer(AliRunDigitizer * manager) ;
virtual ~AliEMCALDigitizer() ;
void Digitize(const Int_t event); // Make Digits from SDigits stored in fSDigits
const Float_t GetPinNoise() const { return fPinNoise;}
const Float_t GetSlope() const { return fSlope; }
const Float_t GetTimeResolution() const { return fTimeResolution ; }
- const Float_t GetECchannel() const { return fADCchannelEC ; }
- const Float_t GetECpedestal() const { return fADCpedestalEC ; }
- const Float_t GetHCchannel() const { return fADCchannelHC ; }
- const Float_t GetHCpedestal() const { return fADCpedestalHC ; }
+ const Float_t GetECAchannel() const { return fADCchannelEC ; }
+ const Float_t GetECApedestal() const { return fADCpedestalEC ; }
+ const Float_t GetHCAchannel() const { return fADCchannelHC ; }
+ const Float_t GetHCApedestal() const { return fADCpedestalHC ; }
const Float_t GetPREchannel() const { return fADCchannelPRE ; }
const Float_t GetPREpedestal() const { return fADCpedestalPRE ; }
void SetPinNoise(Float_t PinNoise ) {fPinNoise = PinNoise;}
//General
- const Int_t GetDigitsInRun() const { return fDigitsInRun; } ;
- void MixWith(char* HeaderFile) ; // Add another one file to mix
- void Print(Option_t* option)const ;
+ const Int_t GetDigitsInRun() const { return fDigitsInRun; }
+ void MixWith(const TString alirunFileName,
+ const TString eventFolderName = AliConfig::fgkDefaultEventFolderName) ; // Add another one file to mix
+ void Print()const ;
AliEMCALDigitizer & operator = (const AliEMCALDigitizer & rvalue) {
// assignement operator requested by coding convention but not needed
Bool_t Init();
void InitParameters() ;
void PrintDigits(Option_t * option) ;
+ void Unload() ;
void WriteDigits(Int_t evt) ; // Writes Digits for particular event
Float_t TimeOfNoise(void) ; // Calculate time signal generated by noise
+
//Calculate the time of crossing of the threshold by front edge
Float_t FrontEdgeTime(TClonesArray * ticks) ;
Int_t DigitizeEnergy(Float_t energy, Int_t absId) ;
private:
- Bool_t fDefaultInit; //! Says if the task was created by defaut ctor (only parameters are initialized)
- Int_t fDigitsInRun ; //! Total number of digits in one run
+ Bool_t fDefaultInit; //! Says if the task was created by defaut ctor (only parameters are initialized)
+ Int_t fDigitsInRun ; //! Total number of digits in one run
+ Bool_t fInit ; //! To avoid overwriting existing files
+
+ Int_t fInput ; // Number of files to merge
+ TString * fInputFileNames ; //[fInput] List of file names to merge
+ TString * fEventNames ; //[fInput] List of event names to merge
+
Float_t fDigitThreshold ; // Threshold for storing digits in EMC
Int_t fMeanPhotonElectron ; // number of photon electrons per GeV deposited energy
Float_t fPedestal ; // Calibration parameters
Float_t fADCchannelPRE ; // width of one ADC channel in PRE section (GeV)
Float_t fADCpedestalPRE ; //
Int_t fNADCPRE ; // number of channels in PRE section ADC
- Bool_t fToSplit ; //! Do we work in the split mode
- TFile * fSplitFile ; //! file in which Digits will eventually be stored
- ClassDef(AliEMCALDigitizer,3) // description
+ TString fEventFolderName; // skowron: name of EFN to read data from in stand alone mode
+
+ ClassDef(AliEMCALDigitizer,4) // description
};
/*
$Log$
+Revision 1.3.4.1 2003/07/07 14:13:31 schutz
+NewIO
+
+Revision 1.4 2002/12/18 08:25:31 morsch
+Correction in efficiency for p < 0.5.
+
Revision 1.3 2002/02/05 11:32:15 morsch
Smearing parameters with TRD included added.
fgInit = kTRUE;
- Info("Init", "geometry of EMCAL named %s is as follows:", name.Data());
- printf( "Tower geometry pre-shower: %d x (%f mm Pb, %f mm Sc) \n", GetNPRLayers(), GetPRPbRadThick(), GetPRScintThick() ) ;
- printf( " ECAL : %d x (%f mm Pb, %f mm Sc) \n", GetNECLayers(), GetECPbRadThick(), GetECScintThick() ) ;
- if ( GetNHCLayers() > 0 )
- printf( " HCAL : %d x (%f mm Pb, %f mm Sc) \n", GetNHCLayers(), GetHCCuRadThick(), GetHCScintThick() ) ;
- printf("Granularity: %d in eta and %d in phi\n", GetNZ(), GetNPhi()) ;
- printf("Layout: phi = (%f, %f), eta = (%f, %f), y = %f\n",
- GetArm1PhiMin(), GetArm1PhiMax(),GetArm1EtaMin(), GetArm1EtaMax(), GetIPDistance() ) ;
+ if (gDebug) {
+ Info("Init", "geometry of EMCAL named %s is as follows:", name.Data());
+ printf( "Tower geometry pre-shower: %d x (%f mm Pb, %f mm Sc) \n", GetNPRLayers(), GetPRPbRadThick(), GetPRScintThick() ) ;
+ printf( " ECAL : %d x (%f mm Pb, %f mm Sc) \n", GetNECLayers(), GetECPbRadThick(), GetECScintThick() ) ;
+ if ( GetNHCLayers() > 0 )
+ printf( " HCAL : %d x (%f mm Pb, %f mm Sc) \n", GetNHCLayers(), GetHCCuRadThick(), GetHCScintThick() ) ;
+ printf("Granularity: %d in eta and %d in phi\n", GetNZ(), GetNPhi()) ;
+ printf("Layout: phi = (%f, %f), eta = (%f, %f), y = %f\n",
+ GetArm1PhiMin(), GetArm1PhiMax(),GetArm1EtaMin(), GetArm1EtaMax(), GetIPDistance() ) ;
+ }
}
//______________________________________________________________________
nindex = index - itowers;
ipre = 1 ;
}
- else if ( IsInECAL(index) ) { // ECAL index
+ else if ( IsInECA(index) ) { // ECAL index
nindex = index ;
ipre = 0 ;
}
- else if ( IsInHCAL(index) ) { // HCAL index
+ else if ( IsInHCA(index) ) { // HCAL index
nindex = index - 2*itowers;
ipre = 2 ;
}
if (sect == 1)
d = GetIP2PRESection() - GetIPDistance() ;
else if (sect == 0)
- d = GetIP2ECALSection() - GetIPDistance() ;
+ d = GetIP2ECASection() - GetIPDistance() ;
else if (sect == 2)
- d = GetIP2HCALSection() - GetIPDistance() ;
+ d = GetIP2HCASection() - GetIPDistance() ;
else
Fatal("PosInAlice", "Unexpected tower section!") ;
Float_t d = 0. ;
if (IsInPRE(absid))
d = GetIP2PRESection() - GetIPDistance() ;
- else if (IsInECAL(absid))
- d = GetIP2ECALSection() - GetIPDistance() ;
- else if (IsInHCAL(absid))
- d = GetIP2HCALSection() - GetIPDistance() ;
+ else if (IsInECA(absid))
+ d = GetIP2ECASection() - GetIPDistance() ;
+ else if (IsInHCA(absid))
+ d = GetIP2HCASection() - GetIPDistance() ;
else
Fatal("PosInAlice", "Unexpected id # %d!", absid) ;
theta = 180.*(2.0*TMath::ATan(TMath::Exp(-eta)))/TMath::Pi();
if ( ipre == 0 )
- cyl_radius = GetIP2ECALSection() ;
+ cyl_radius = GetIP2ECASection() ;
else if ( ipre == 1 )
cyl_radius = GetIP2PRESection() ;
else if ( ipre == 2 )
- cyl_radius = GetIP2HCALSection() ;
+ cyl_radius = GetIP2HCASection() ;
else
Fatal("XYZFromIndex", "Unexpected Tower section # %d", ipre) ;
PosInAlice(absid, theta, phi) ;
- if ( IsInECAL(absid) )
- cyl_radius = GetIP2ECALSection() ;
+ if ( IsInECA(absid) )
+ cyl_radius = GetIP2ECASection() ;
else if ( IsInPRE(absid) )
cyl_radius = GetIP2PRESection() ;
- else if ( IsInHCAL(absid) )
- cyl_radius = GetIP2HCALSection() ;
+ else if ( IsInHCA(absid) )
+ cyl_radius = GetIP2HCASection() ;
else
Fatal("XYZFromIndex", "Unexpected Tower section") ;
const Float_t GetArm1EtaMin() const { return fArm1EtaMin;}
const Float_t GetArm1EtaMax() const { return fArm1EtaMax;}
const Float_t GetIPDistance() const { return fIPDistance ; }
- const Float_t GetIP2PRESection() const { return (GetIPDistance() + GetAlFrontThickness() + GetGap2Active() ) ;}
- const Float_t GetIP2ECALSection() const { return ( GetIP2PRESection() + GetNPRLayers() * ( GetPRScintThick() + GetPRPbRadThick() ) ) ; }
- const Float_t GetIP2HCALSection() const { return ( GetIP2ECALSection() + GetNECLayers() * ( GetECScintThick() + GetECPbRadThick() ) ) ; }
+ const Float_t GetIP2PRESection() const { return (GetIPDistance() + GetAlFrontThickness() + GetGap2Active() ) ;}
+ const Float_t GetIP2ECASection() const { return ( GetIP2PRESection() + GetNPRLayers() * ( GetPRScintThick() + GetPRPbRadThick() ) ) ; }
+ const Float_t GetIP2HCASection() const { return ( GetIP2ECASection() + GetNECLayers() * ( GetECScintThick() + GetECPbRadThick() ) ) ; }
const Float_t GetEnvelop(Int_t index) const { return fEnvelop[index] ; }
const Float_t GetShellThickness() const { return fShellThickness ; }
const Float_t GetZLength() const { return fZLength ; }
const Float_t GetSummationFraction() const {return fSummationFraction ; }
const Bool_t IsInPRE(Int_t index) const { if ( (index > (GetNZ() * GetNPhi()) && (index <= 2 * (GetNZ() * GetNPhi())))) return kTRUE; else return kFALSE ;}
- const Bool_t IsInECAL(Int_t index) const { if ( (index > 0 && (index <= GetNZ() * GetNPhi()))) return kTRUE; else return kFALSE ;}
- const Bool_t IsInHCAL(Int_t index) const { if ( (index > 2*(GetNZ() * GetNPhi()) && (index <= 3 * (GetNZ() * GetNPhi())))) return kTRUE; else return kFALSE ;} ;
+ const Bool_t IsInECA(Int_t index) const { if ( (index > 0 && (index <= GetNZ() * GetNPhi()))) return kTRUE; else return kFALSE ;}
+ const Bool_t IsInHCA(Int_t index) const { if ( (index > 2*(GetNZ() * GetNPhi()) && (index <= 3 * (GetNZ() * GetNPhi())))) return kTRUE; else return kFALSE ;} ;
Float_t AngleFromEta(Float_t eta){ // returns angle in radians for a given
// pseudorapidity.
**************************************************************************/
/* $Id: */
+
/* $Log:
29.05.2001 Yuri Kharlov:
Everywhere reading the treese TTree->GetEvent(i)
is replaced by reading the branches TBranch->GetEntry(0)
*/
-
/* $Log:
08.2002 Dmitri Peressounko:
+
*/
//_________________________________________________________________________
// A singleton. This class should be used in the analysis stage to get
// reconstructed objects: Digits, RecPoints, TrackSegments and RecParticles,
// instead of directly reading them from galice.root file. This container
-// ensures, that one reads Digits, made of these particular digits, RecPoints,
+// ensures, that one reads Digits, made of these particular digits, RecPoints,
// made of these particular RecPoints, TrackSegments and RecParticles.
// This becomes non trivial if there are several identical branches, produced with
// different set of parameters.
// for(Int_t irecp = 0; irecp < gime->NRecParticles() ; irecp++)
// AliEMCALRecParticle * part = gime->RecParticle(1) ;
// ................
-// please->GetEvent(event) ; // reads new event from galice.root
+// gime->Event(event) ; // reads new event from galice.root
//
//*-- Author: Yves Schutz (SUBATECH) & Dmitri Peressounko (RRC KI & SUBATECH)
//*-- Completely redesigned by Dmitri Peressounko March 2001
//
//*-- YS June 2001 : renamed the original AliEMCALIndexToObject and make
-//*-- systematic usage of TFolders without changing the interface
-//*-- YS August 2002 : clone PHOS as closely as possible and intoduction
-// of new IO (à la PHOS)
-
+//*-- systematic usage of TFolders without changing the interface
//////////////////////////////////////////////////////////////////////////////
-
-
// --- ROOT system ---
+#include "TSystem.h"
#include "TFile.h"
-#include "TTree.h"
+// #include "TTree.h"
#include "TROOT.h"
-#include "TObjString.h"
-#include "TFolder.h"
-#include "TParticle.h"
+// #include "TObjString.h"
+// #include "TFolder.h"
+// #include "TParticle.h"
// --- Standard library ---
-#include <Riostream.h>
-
// --- AliRoot header files ---
-
-#include "AliRun.h"
-#include "AliConfig.h"
+// #include "AliRun.h"
+// #include "AliConfig.h"
#include "AliEMCALGetter.h"
-#include "AliEMCAL.h"
-#include "AliEMCALDigitizer.h"
-#include "AliEMCALSDigitizer.h"
-#include "AliEMCALClusterizerv1.h"
-#include "AliEMCALTrackSegmentMakerv1.h"
-#include "AliEMCALTrackSegment.h"
-#include "AliEMCALPIDv1.h"
-#include "AliEMCALGeometry.h"
+#include "AliRunLoader.h"
+#include "AliStack.h"
+#include "AliEMCALLoader.h"
ClassImp(AliEMCALGetter)
+
+AliEMCALGetter * AliEMCALGetter::fgObjGetter = 0 ;
+AliEMCALLoader * AliEMCALGetter::fgEmcalLoader = 0;
+Int_t AliEMCALGetter::fgDebug = 0;
- AliEMCALGetter * AliEMCALGetter::fgObjGetter = 0 ;
- TFile * AliEMCALGetter::fFile = 0 ;
+// TFile * AliEMCALGetter::fgFile = 0 ;
//____________________________________________________________________________
-
-AliEMCALGetter::AliEMCALGetter(const char* headerFile, const char* branchTitle, const Bool_t toSplit)
+AliEMCALGetter::AliEMCALGetter(const char* headerFile, const char* version, Option_t * openingOption)
{
- // This is the ctor called by GetInstance and the only one that can be used
-
- if ( fHeaderFile.Contains("_") ) {
- Fatal("AliEMCALGetter","Invalid file name (_ not allowed) %s",fHeaderFile.Data()) ;
- }
-
- //Initialize all data
-
- fFailed = kFALSE ;
- fDebug = 0 ;
- fAlice = 0 ;
-
- fToSplit = toSplit ;
- fHeaderFile = headerFile ;
-
- fPrimaries = new TObjArray(1) ;
+ // ctor only called by Instance()
- fModuleFolder = dynamic_cast<TFolder*>(gROOT->FindObjectAny("Folders/Run/Configuration/Modules"));
- fPrimariesFolder = dynamic_cast<TFolder*>(gROOT->FindObjectAny("Folders/RunMC/Event/Data"));
- fHitsFolder = dynamic_cast<TFolder*>(gROOT->FindObjectAny("Folders/RunMC/Event/Data/Hits"));
- fSDigitsFolder = dynamic_cast<TFolder*>(gROOT->FindObjectAny("Folders/RunMC/Event/Data/SDigits"));
- fDigitsFolder = dynamic_cast<TFolder*>(gROOT->FindObjectAny("Folders/Run/Event/Data"));
- fRecoFolder = dynamic_cast<TFolder*>(gROOT->FindObjectAny("Folders/Run/Event/RecData"));
- //fQAFolder = dynamic_cast<TFolder*>(gROOT->FindObjectAny("Folders/Run/Conditions/QA"));
- fTasksFolder = dynamic_cast<TFolder*>(gROOT->FindObjectAny("Folders/Tasks")) ;
-
- //Set titles to branches and create EMCAL specific folders
-
- SetTitle(branchTitle) ;
-
- if ( fHeaderFile != "aliroot" ) { // to call the getter without a file
-
- //open headers file
-
- fFile = static_cast<TFile*>(gROOT->GetFile(fHeaderFile.Data() ) ) ;
-
- if(!fFile){ //if file was not opened yet, read gAlice
- fFile = TFile::Open(fHeaderFile.Data(), "update") ;
- if (!fFile->IsOpen()) {
- Error("AliEMCALGetter","Cannot open %s",fHeaderFile.Data()) ;
-