1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
20 //-----------------------------------------------------------------------------
22 // Origin: Marian Ivanov, Uni. of Bratislava, ivanov@fmph.uniba.sk
24 // Implementation of class AliTPCD
26 //-----------------------------------------------------------------------------
29 #include "AliTPCParam.h"
30 #include "AliTPCRF1D.h"
31 #include "AliTPCPRF2D.h"
33 #include "TClonesArray.h"
35 #include "TBranchClones.h"
37 #include "TDirectory.h"
41 // other include files follow here
45 //_____________________________________________________________
46 AliTPCD::AliTPCD(Text_t * name,
47 AliTPCParam * param, AliTPCPRF2D* prf, AliTPCRF1D* prfz)
49 //construct new object's or accept objects sent to constructor
50 //AliTPCD handle sent object and is repsonsible for
55 <img src="picts/alitpcd.gif">
60 ( (param->IsA()->InheritsFrom("AliTPCParam")==kTRUE ) ))
63 fParam= new AliTPCParam;
64 if ( (prf!=0) && (prf->IsA()->InheritsFrom("AliTPCPRF2D")==kTRUE) )
67 fPRF = new AliTPCPRF2D;
68 if ( (prfz!=0) && (prfz->IsA()->InheritsFrom("AliTPCRF1D")==kTRUE) )
71 fRF = new AliTPCRF1D(kTRUE);
72 fDigits = new TClonesArray("AliTPCdigit",5000);
78 if (fParam!=0) fParam->Delete();
79 if (fPRF!=0) fPRF->Delete();
80 if (fRF!=0) fRF->Delete();
81 if (fDigits!=0) fDigits->Delete();
85 Bool_t AliTPCD::SetTree(Int_t nevent, TDirectory *dir )
88 // Get Hits Tree header from file
89 sprintf(treeName,"TreeD%d_%s",nevent,GetName());
90 fTreeD = (TTree*)dir->Get(treeName);
91 if (fTreeD == 0) return kFALSE;
93 TBranch *b = fTreeD->GetBranch("Digits");
94 if (b==0) return kFALSE;
95 b->SetAddress(&fDigits);
100 Bool_t AliTPCD::MakeTree(Int_t nevent)
103 // Get Hits Tree header from file
104 sprintf(treeName,"TreeD%d_%s",nevent,GetName());
105 fTreeD = new TTree(treeName,treeName);
106 if (fTreeD == 0) return kFALSE;
108 TBranch *b = fTreeD->Branch("Digits",&fDigits,40000);
109 if (b==0) return kFALSE;
110 b->SetAddress(&fDigits);
117 if (fTreeD!=0) fTreeD->Fill();
124 void AliTPCD::Streamer(TBuffer &R__b)
126 // Stream an object of class AliTPCD.
127 if (R__b.IsReading()) {
128 Version_t R__v = R__b.ReadVersion(); if (R__v) { }
129 TNamed::Streamer(R__b);
132 fParam = new AliTPCParam;
136 fPRF = new AliTPCPRF2D;
140 fRF = new AliTPCRF1D;
144 fRF = new AliTPCRF1D;
151 R__b.WriteVersion(AliTPCD::IsA());
152 TNamed::Streamer(R__b);
156 if (fTreeD!=0) fTreeD->Write();