#include <TVirtualMC.h>
#include <TString.h>
#include <TF2.h>
+#include <TStopwatch.h>
#include "AliArrayBranch.h"
#include "AliClusters.h"
#include "AliTrackReference.h"
#include "AliMC.h"
#include "AliTPCDigitizer.h"
+#include "AliTPCBuffer.h"
+#include "AliTPCDDLRawData.h"
#include "AliTPCclustererMI.h"
#include "AliTPCtrackerMI.h"
#include "AliTPCpidESD.h"
}
-//_____________________________________________________________________________
-void AliTPC::Reconstruct() const
-{
-// reconstruct clusters
-
- AliLoader* loader = GetLoader();
- loader->LoadRecPoints("recreate");
- loader->LoadDigits("read");
-
- AliTPCclustererMI clusterer(fTPCParam);
- AliRunLoader* runLoader = loader->GetRunLoader();
- Int_t nEvents = runLoader->GetNumberOfEvents();
-
- for (Int_t iEvent = 0; iEvent < nEvents; iEvent++) {
- runLoader->GetEvent(iEvent);
-
- TTree* treeClusters = loader->TreeR();
- if (!treeClusters) {
- loader->MakeTree("R");
- treeClusters = loader->TreeR();
- }
- TTree* treeDigits = loader->TreeD();
- if (!treeDigits) {
- Error("Reconstruct", "Can't get digits tree !");
- return;
- }
-
-// clusterer.Digits2Clusters(treeDigits, treeClusters);
- clusterer.SetInput(treeDigits);
- clusterer.SetOutput(treeClusters);
- clusterer.Digits2Clusters();
-
- loader->WriteRecPoints("OVERWRITE");
- }
-
- loader->UnloadRecPoints();
- loader->UnloadDigits();
-}
-
-//_____________________________________________________________________________
-AliTracker* AliTPC::CreateTracker() const
-{
-// create a TPC tracker
-
- return new AliTPCtrackerMI(fTPCParam);
-}
-
-//_____________________________________________________________________________
-void AliTPC::FillESD(AliESD* esd) const
-{
-// make PID
-
- Double_t parTPC[] = {47., 0.10, 10.};
- AliTPCpidESD tpcPID(parTPC);
- tpcPID.MakePID(esd);
-}
-
-
//_____________________________________________________________________________
void AliTPC::CreateMaterials()
{
else branch = TreeH()->GetBranch("TPC");
Stat_t ntracks = TreeH()->GetEntries();
// loop over all hits
- cout<<"\nAliTPC::SetActiveSectors(): Got "<<ntracks<<" tracks\n";
+ if (GetDebug()) cout<<"\nAliTPC::SetActiveSectors(): Got "<<ntracks<<" tracks\n";
for(Int_t track=0;track<ntracks;track++)
{
"Dummy function ! Call AliTPCclusterer::Digits2Clusters(...) instead !");
}
+
+//_____________________________________________________________________________
+void AliTPC::Digits2Raw()
+{
+// convert digits of the current event to raw data
+
+ static const Int_t kThreshold = 0;
+ static const Bool_t kCompress = kTRUE;
+
+ fLoader->LoadDigits();
+ TTree* digits = fLoader->TreeD();
+ if (!digits) {
+ Error("Digits2Raw", "no digits tree");
+ return;
+ }
+
+ AliSimDigits digarr;
+ AliSimDigits* digrow = &digarr;
+ digits->GetBranch("Segment")->SetAddress(&digrow);
+
+ const char* fileName = "AliTPCDDL.dat";
+ AliTPCBuffer* buffer = new AliTPCBuffer(fileName);
+ //Verbose level
+ // 0: Silent
+ // 1: cout messages
+ // 2: txt files with digits
+ //BE CAREFUL, verbose level 2 MUST be used only for debugging and
+ //it is highly suggested to use this mode only for debugging digits files
+ //reasonably small, because otherwise the size of the txt files can reach
+ //quickly several MB wasting time and disk space.
+ buffer->SetVerbose(0);
+
+ Int_t nEntries = Int_t(digits->GetEntries());
+ Int_t previousSector = -1;
+ Int_t subSector = 0;
+ for (Int_t i = 0; i < nEntries; i++) {
+ digits->GetEntry(i);
+ Int_t sector, row;
+ fTPCParam->AdjustSectorRow(digarr.GetID(), sector, row);
+ if(previousSector != sector) {
+ subSector = 0;
+ previousSector = sector;
+ }
+
+ if (sector < 36) { //inner sector [0;35]
+ if (row != 30) {
+ //the whole row is written into the output file
+ buffer->WriteRowBinary(kThreshold, digrow, 0, 0, 0,
+ sector, subSector, row);
+ } else {
+ //only the pads in the range [37;48] are written into the output file
+ buffer->WriteRowBinary(kThreshold, digrow, 37, 48, 1,
+ sector, subSector, row);
+ subSector = 1;
+ //only the pads outside the range [37;48] are written into the output file
+ buffer->WriteRowBinary(kThreshold, digrow, 37, 48, 2,
+ sector, subSector, row);
+ }//end else
+
+ } else { //outer sector [36;71]
+ if (row == 54) subSector = 2;
+ if ((row != 27) && (row != 76)) {
+ buffer->WriteRowBinary(kThreshold, digrow, 0, 0, 0,
+ sector, subSector, row);
+ } else if (row == 27) {
+ //only the pads outside the range [43;46] are written into the output file
+ buffer->WriteRowBinary(kThreshold, digrow, 43, 46, 2,
+ sector, subSector, row);
+ subSector = 1;
+ //only the pads in the range [43;46] are written into the output file
+ buffer->WriteRowBinary(kThreshold, digrow, 43, 46, 1,
+ sector, subSector, row);
+ } else if (row == 76) {
+ //only the pads outside the range [33;88] are written into the output file
+ buffer->WriteRowBinary(kThreshold, digrow, 33, 88, 2,
+ sector, subSector, row);
+ subSector = 3;
+ //only the pads in the range [33;88] are written into the output file
+ buffer->WriteRowBinary(kThreshold, digrow, 33, 88, 1,
+ sector, subSector, row);
+ }
+ }//end else
+ }//end for
+
+ delete buffer;
+ fLoader->UnloadDigits();
+
+ AliTPCDDLRawData rawWriter;
+ rawWriter.SetVerbose(0);
+
+ rawWriter.RawData(fileName);
+ gSystem->Unlink(fileName);
+
+ if (kCompress) {
+ Info("Digits2Raw", "compressing raw data");
+ rawWriter.RawDataCompDecompress(kTRUE);
+ gSystem->Unlink("Statistics");
+ }
+}
+
+
extern Double_t SigmaY2(Double_t, Double_t, Double_t);
extern Double_t SigmaZ2(Double_t, Double_t);
//_____________________________________________________________________________
cout<<"fTPCParam->GetTitle() = "<<fTPCParam->GetTitle()<<endl;
- AliRunLoader* rl = (AliRunLoader*)fLoader->GetEventFolder()->FindObject(AliRunLoader::fgkRunLoaderName);
+ AliRunLoader* rl = (AliRunLoader*)fLoader->GetEventFolder()->FindObject(AliRunLoader::GetRunLoaderName());
rl->CdGAFile();
//fTPCParam->Write(fTPCParam->GetTitle());
} // end of loop over sectors
- cerr<<"Number of made clusters : "<<nclusters<<" \n";
+ // cerr<<"Number of made clusters : "<<nclusters<<" \n";
fLoader->WriteRecPoints("OVERWRITE");
// setting the defaults
//
- cerr<<"Setting default parameters...\n";
+ // cerr<<"Setting default parameters...\n";
// Set response functions
//
- AliRunLoader* rl = (AliRunLoader*)fLoader->GetEventFolder()->FindObject(AliRunLoader::fgkRunLoaderName);
+ AliRunLoader* rl = (AliRunLoader*)fLoader->GetEventFolder()->FindObject(AliRunLoader::GetRunLoaderName());
rl->CdGAFile();
AliTPCParamSR *param=(AliTPCParamSR*)gDirectory->Get("75x40_100x60");
if(param){
//----------------------------------------------------
// Loop over all sectors for a single event
//----------------------------------------------------
- AliRunLoader* rl = (AliRunLoader*)fLoader->GetEventFolder()->FindObject(AliRunLoader::fgkRunLoaderName);
+ AliRunLoader* rl = (AliRunLoader*)fLoader->GetEventFolder()->FindObject(AliRunLoader::GetRunLoaderName());
rl->GetEvent(eventnumber);
if (fLoader->TreeH() == 0x0)
{
fDigitsSwitch=0; // standard digits
- cerr<<"Digitizing TPC -- normal digits...\n";
+ // cerr<<"Digitizing TPC -- normal digits...\n";
for(Int_t isec=0;isec<fTPCParam->GetNSector();isec++)
if (IsSectorActive(isec))
SetDigitsArray(arr);
- cerr<<"Digitizing TPC -- summable digits...\n";
+ // cerr<<"Digitizing TPC -- summable digits...\n";
fDigitsSwitch=1; // summable digits