#include <TVirtualMC.h>
#include <AliESD.h>
+#include "AliLog.h"
+#include "AliMC.h"
#include "AliLoader.h"
#include "AliRun.h"
+
#include "AliSTART.h"
#include "AliSTARTLoader.h"
#include "AliSTARTdigit.h"
#include "AliSTARThit.h"
-#include "AliSTARThitPhoton.h"
-#include "AliSTARTvertex.h"
-#include "AliMC.h"
#include "AliSTARTDigitizer.h"
+#include "AliSTARTRawData.h"
ClassImp(AliSTART)
-static AliSTARTdigit *digits;
+ //static AliSTARTdigit *digits;
//_____________________________________________________________________________
AliSTART::AliSTART()
fIshunt = 1;
fHits = 0;
fDigits = 0;
- fPhotons = 0;
}
//_____________________________________________________________________________
// Initialise Hit array
fHits = new TClonesArray("AliSTARThit", 405);
gAlice->GetMCApp()->AddHitList(fHits);
-
- fPhotons = new TClonesArray("AliSTARThitPhoton", 10000);
- gAlice->GetMCApp()->AddHitList (fPhotons);
- if (GetDebug()>2) cout<<" Debug "<<endl;
fIshunt = 1;
fIdSens = 0;
- fNPhotons = 0;
SetMarkerColor(kRed);
}
fHits->Delete();
delete fHits;
}
- if (fPhotons) {
- fPhotons->Delete();
- delete fPhotons;
- }
}
//_____________________________________________________________________________
new(lhits[fNhits++]) AliSTARThit(fIshunt,track,vol,hits);
}
-//_____________________________________________________________________________
-void AliSTART::AddHitPhoton(Int_t track, Int_t *vol, Float_t *hits)
-{
- // Add a START hit of photons
-
- TClonesArray &lhits = *fPhotons;
- new(lhits[fNPhotons++]) AliSTARThitPhoton(fIshunt,track,vol,hits);
-}
//_____________________________________________________________________________
// Specific START branches
//
// Create Tree branches for the START.
- Int_t buffersize = 4000;
char branchname[20];
sprintf(branchname,"%s",GetName());
-
- const char *cD = strstr(option,"D");
const char *cH = strstr(option,"H");
if (cH && fLoader->TreeH())
{
- if (fPhotons == 0x0) fPhotons = new TClonesArray("AliSTARThitPhoton", 10000);
- sprintf (branchname, "%shitPhoton", GetName());
- MakeBranchInTree (fLoader->TreeH(), branchname, &fPhotons, 50000, 0);
if (fHits == 0x0) fHits = new TClonesArray("AliSTARThit", 405);
}
AliDetector::MakeBranch(option);
-
- if (cD) {
- digits = new AliSTARTdigit();
- MakeBranchInTree(fLoader->TreeD(), branchname, "AliSTARTdigit", digits, buffersize, 1, 0);
- }
}
//_____________________________________________________________________________
{
AliDetector::ResetHits();
- fNPhotons = 0;
- if (fPhotons) fPhotons->Clear();
}
//_____________________________________________________________________________
void AliSTART::SetTreeAddress()
{
- TBranch *branch;
+
TTree *treeH;
-
-
treeH = TreeH();
if (treeH)
{
- if (fPhotons == 0x0) fPhotons = new TClonesArray("AliSTARThitPhoton", 10000);
- branch = treeH->GetBranch("STARThitPhoton");
- if (branch) branch->SetAddress(&fPhotons);
if (fHits == 0x0) fHits = new TClonesArray("AliSTARThit", 405);
}
//______________________________________________________________________
AliLoader* AliSTART::MakeLoader(const char* topfoldername)
{
- Info("MakeLoader", "Creating AliSTARTLoader. Top folder is %s.", topfoldername);
+
+ AliDebug(2,Form(" Creating AliSTARTLoader "));
fLoader = new AliSTARTLoader(GetName(), topfoldername);
return fLoader;
}
{
return new AliSTARTDigitizer(manager);
}
-
-//_____________________________________________________________________________
-void AliSTART::FillESD(AliESD* pESD) const
+//____________________________________________________________________________
+void AliSTART::Digits2Raw()
{
- AliSTARTvertex reco;
- reco.Reconstruct(fLoader->GetRunLoader(), pESD);
-}
+//
+// Starting from the START digits, writes the Raw Data objects
+//
+ AliSTARTLoader* pStartLoader = (AliSTARTLoader*)fLoader;
+ pStartLoader ->LoadDigits();
+ AliSTARTdigit* fDigits=pStartLoader->Digits();
+ AliSTARTRawData rawWriter;
+ rawWriter.SetVerbose(0);
+
+ AliDebug(2,Form(" Formatting raw data for START "));
+
+ rawWriter.RawDataSTART (fDigits);
+ pStartLoader->UnloadDigits();
+
+}