/*
$Log$
+Revision 1.35 2002/03/28 14:59:07 cblume
+Coding conventions
+
Revision 1.34 2002/03/25 20:00:44 cblume
Introduce parameter class and regions of interest for merging
}
+//_____________________________________________________________________________
+void AliTRDdigitizer::InitOutput(TFile *file, Int_t iEvent)
+{
+ //
+ // Initializes the output branches
+ //
+
+ fEvent = iEvent;
+ fDigitsManager->MakeTreeAndBranches(file,iEvent);
+
+}
virtual Bool_t SDigits2Digits();
virtual Bool_t WriteDigits() const;
+ void InitOutput(TFile *file, Int_t iEvent);
+
virtual void SetCompress(Int_t c = 1) { fCompress = c; };
virtual void SetDebug(Int_t v = 1) { fDebug = v; };
virtual void SetSDigits(Int_t v = 1) { fSDigits = v; };
/*
$Log$
+Revision 1.17 2002/03/28 14:59:07 cblume
+Coding conventions
+
Revision 1.16 2002/02/12 11:42:08 cblume
Remove fTree from destructor
}
+//_____________________________________________________________________________
+void AliTRDdigitsManager::MakeTreeAndBranches(TFile *file, Int_t iEvent)
+{
+ //
+ // Creates tree for (s)digits in the specified file
+ //
+
+ fEvent = iEvent;
+ TDirectory *wd = gDirectory;
+ file->cd();
+ MakeBranch();
+ wd->cd();
+
+}
+
//_____________________________________________________________________________
Bool_t AliTRDdigitsManager::MakeBranch(const Char_t *file)
{
}
// Write the new tree to the output file
- fTree->Write();
+ //fTree->Write();
+ fTree->AutoSave(); // Modification by Jiri
return kTRUE;
virtual Bool_t Open(const Char_t *file);
virtual Bool_t MakeBranch(const Char_t *file = 0);
virtual Bool_t MakeBranch(TTree *tree, const Char_t *file = 0);
+ void MakeTreeAndBranches(TFile *treeFile, Int_t iEvent);
virtual Bool_t ReadDigits(TTree *tree = 0);
virtual Bool_t WriteDigits();
/*
$Log$
+Revision 1.3 2002/03/28 14:59:07 cblume
+Coding conventions
+
Revision 1.2 2002/03/28 10:00:36 hristov
Some additional initialisation
diff = 0;
do {
diff = bin - pad[ipos2++];
- } while (diff > 0);
- ipos2--;
- if (ipos2 >= kPRFbin) ipos2 = kPRFbin - 1;
- ipos1 = ipos2 - 1;
-
- fPRFsmp[iPla*fPRFbin+iBin] = prf[iPla][ipos2]
- + diff * (prf[iPla][ipos2] - prf[iPla][ipos1])
- / sPRFwid;
+ } while ((diff > 0) && (ipos2 < kPRFbin));
+ if (ipos2 == kPRFbin) {
+ fPRFsmp[iPla*fPRFbin+iBin] = prf[iPla][ipos2-1];
+ }
+ else if (ipos2 == 1) {
+ fPRFsmp[iPla*fPRFbin+iBin] = prf[iPla][ipos2-1];
+ }
+ else {
+ ipos2--;
+ if (ipos2 >= kPRFbin) ipos2 = kPRFbin - 1;
+ ipos1 = ipos2 - 1;
+ fPRFsmp[iPla*fPRFbin+iBin] = prf[iPla][ipos2]
+ + diff * (prf[iPla][ipos2] - prf[iPla][ipos1])
+ / sPRFwid;
+ }
}
}
virtual void SampleTRF();
virtual void FillLUT();
- ClassDef(AliTRDparameter,1) // TRD parameter class
+ ClassDef(AliTRDparameter,2) // TRD parameter class
};
+
Int_t AliTRDtest()
{
//
Int_t rc = 0;
+ TFile *file;
+
// Initialize the test setup
gAlice->Init("$(ALICE_ROOT)/TRD/AliTRDconfig.C");
gAlice->Run(1);
if (gAlice) delete gAlice;
- TFile *file = (TFile *) gROOT->GetListOfFiles()->FindObject("TRD_test.root");
+ file = (TFile *) gROOT->GetListOfFiles()->FindObject("TRD_test.root");
gAlice = (AliRun *) file->Get("gAlice");
// Analyze the TRD hits
if (rc = AliTRDcreateDigits()) return rc;
if (gAlice) delete gAlice;
- TFile *file = (TFile *) gROOT->GetListOfFiles()->FindObject("TRD_test.root");
+ file = (TFile *) gROOT->GetListOfFiles()->FindObject("TRD_test.root");
gAlice = (AliRun *) file->Get("gAlice");
// Analyze the digits
if (rc = AliTRDcreateCluster()) return rc;
if (gAlice) delete gAlice;
- TFile *file = (TFile *) gROOT->GetListOfFiles()->FindObject("TRD_test.root");
+ file = (TFile *) gROOT->GetListOfFiles()->FindObject("TRD_test.root");
gAlice = (AliRun *) file->Get("gAlice");
- // Analyze the digits
+ // Analyze the cluster
if (rc = AliTRDanalyzeCluster()) return rc;
+ //file = (TFile *) gROOT->GetListOfFiles()->FindObject("TRD_test.root");
+ //file->Close();
+
+ // Find the tracks
+ //if (rc = AliTRDcreateTracks()) return rc;
+
return rc;
}
// Create the digits manager
AliTRDdigitsManager *digitsManager = new AliTRDdigitsManager();
+ digitsManager->SetDebug(1);
digitsManager->Open("TRD_test.root");
return rc;
}
+
+//_____________________________________________________________________________
+Int_t AliTRDcreateTracks()
+{
+ //
+ // Creates the tracks
+ //
+
+ Int_t rc = 0;
+
+ // Create the tracker
+ AliTRDtracker *tracker = new AliTRDtracker("TRDtracker","TRD tracker");
+
+ // Read in the kine tree and the cluster
+ tracker->GetEvent("TRD_test.root","TRD_test.root");
+
+ // Find the tracks
+ TH1F *hs = new TH1F("hs","hs",100,0.0,1.0);
+ TH1F *hd = new TH1F("hd","hd",100,0.0,1.0);
+ tracker->Clusters2Tracks(hs,hd);
+
+ // Store the tracks
+ tracker->WriteTracks("TRD_test.root");
+
+ return rc;
+
+}