//-------------------------------------------------------
// Implementation of the TPC clusterer
//
+// 1. The Input data for reconstruction - Options
+// 1.a Simulated data - TTree - invoked Digits2Clusters()
+// 1.b Raw data - Digits2Clusters(AliRawReader* rawReader);
+//
+// 2. The Output data
+// 2.a TTree with clusters - if SetOutput(TTree * tree) invoked
+// 2.b TObjArray - Faster option for HLT
+//
+// 3. Reconstruction setup
+// see AliTPCRecoParam for list of parameters
+// The reconstruction parameterization taken from the
+// AliTPCReconstructor::GetRecoParam()
+// Possible to setup it in reconstruction macro AliTPCReconstructor::SetRecoParam(...)
+//
+//
+//
// Origin: Marian Ivanov
//-------------------------------------------------------
fEventType(0),
fInput(0),
fOutput(0),
+ fOutputArray(0),
fRowCl(0),
fRowDig(0),
fParam(0),
//
fIsOldRCUFormat = kFALSE;
fInput =0;
- fOutput=0;
fParam = par;
if (recoParam) {
fRecoParam = recoParam;
fEventType(0),
fInput(0),
fOutput(0),
+ fOutputArray(0),
fRowCl(0),
fRowDig(0),
fParam(0),
}
//______________________________________________________________
AliTPCclustererMI::~AliTPCclustererMI(){
+ //
+ //
+ //
if (fDebugStreamer) delete fDebugStreamer;
+ if (fOutputArray){
+ fOutputArray->Delete();
+ delete fOutputArray;
+ }
}
void AliTPCclustererMI::SetInput(TTree * tree)
void AliTPCclustererMI::SetOutput(TTree * tree)
{
//
+ // Set the output tree
+ // If not set the ObjArray used - Option for HLT
//
- fOutput= tree;
+ if (!tree) return;
+ fOutput= tree;
AliTPCClustersRow clrow;
AliTPCClustersRow *pclrow=&clrow;
clrow.SetClass("AliTPCclusterMI");
}
+void AliTPCclustererMI::FillRow(){
+ //
+ // fill the output container -
+ // 2 Options possible
+ // Tree
+ // TObjArray
+ //
+ if (fOutput) fOutput->Fill();
+ if (!fOutput){
+ //
+ if (!fOutputArray) fOutputArray = new TObjArray;
+ if (fRowCl) fOutputArray->AddAt(fRowCl->Clone(), fRowCl->GetID());
+ }
+}
+
Float_t AliTPCclustererMI::GetSigmaY2(Int_t iz){
// sigma y2 = in digits - we don't know the angle
Float_t z = iz*fParam->GetZWidth()+fParam->GetNTBinsL1()*fParam->GetZWidth();
return;
}
- if (!fOutput) {
- Error("Digits2Clusters", "output tree not initialised");
- return;
- }
-
AliTPCCalPad * gainTPC = AliTPCcalibDB::Instance()->GetPadGainFactor();
AliTPCCalPad * noiseTPC = AliTPCcalibDB::Instance()->GetPadNoise();
AliSimDigits digarr, *dummy=&digarr;
AliTPCCalROC * gainROC = gainTPC->GetCalROC(fSector); // pad gains per given sector
AliTPCCalROC * noiseROC = noiseTPC->GetCalROC(fSector); // noise per given sector
//
- AliTPCClustersRow *clrow= new AliTPCClustersRow();
- fRowCl = clrow;
- clrow->SetClass("AliTPCclusterMI");
- clrow->SetArray(1);
+ fRowCl= new AliTPCClustersRow();
+ fRowCl->SetClass("AliTPCclusterMI");
+ fRowCl->SetArray(1);
- clrow->SetID(digarr.GetID());
- fOutput->GetBranch("Segment")->SetAddress(&clrow);
+ fRowCl->SetID(digarr.GetID());
+ if (fOutput) fOutput->GetBranch("Segment")->SetAddress(&fRowCl);
fRx=fParam->GetPadRowRadii(fSector,row);
digarr.ExpandTrackBuffer();
FindClusters(noiseROC);
-
- fOutput->Fill();
- delete clrow;
+ FillRow();
+ delete fRowCl;
nclusters+=fNcluster;
delete[] fBins;
delete[] fSigBins;
// using an option of the TPC reconstructor
//-----------------------------------------------------------------
- if (!fOutput) {
- Error("Digits2Clusters", "output tree not initialised");
- return;
- }
fRowDig = NULL;
AliTPCROC * roc = AliTPCROC::Instance();
fRowCl->SetClass("AliTPCclusterMI");
fRowCl->SetArray(1);
fRowCl->SetID(fParam->GetIndex(fSector, fRow));
- fOutput->GetBranch("Segment")->SetAddress(&fRowCl);
+ if (fOutput) fOutput->GetBranch("Segment")->SetAddress(&fRowCl);
fRx = fParam->GetPadRowRadii(fSector, fRow);
fPadLength = fParam->GetPadPitchLength(fSector, fRow);
fNSigBins = allNSigBins[fRow];
FindClusters(noiseROC);
-
- fOutput->Fill();
+ FillRow();
delete fRowCl;
nclusters += fNcluster;
} // End of loop to find clusters
if (rawReader->GetEventId() && fOutput ){
Info("Digits2Clusters", "File %s Event\t%d\tNumber of found clusters : %d\n", fOutput->GetName(),*(rawReader->GetEventId()), nclusters);
+ }else{
+ Info("Digits2Clusters", "Event\t%d\tNumber of found clusters : %d\n",*(rawReader->GetEventId()), nclusters);
+
}
-
+
}
void AliTPCclustererMI::FindClusters(AliTPCCalROC * noiseROC)
// add virtual charge at the edge
//
Double_t kMaxDumpSize = 500000;
- if (fRecoParam->GetCalcPedestal() && fOutput->GetZipBytes()< kMaxDumpSize) fBDumpSignal =kTRUE; //dump signal flag
- //
+ if (!fOutput) {
+ fBDumpSignal =kFALSE;
+ }else{
+ if (fRecoParam->GetCalcPedestal() && fOutput->GetZipBytes()< kMaxDumpSize) fBDumpSignal =kTRUE; //dump signal flag
+ }
+
fNcluster=0;
fLoop=1;
Int_t crtime = Int_t((fParam->GetZLength(fSector)-fRecoParam->GetCtgRange()*fRx)/fZWidth-fParam->GetNTBinsL1()-5);
virtual void SetOldRCUFormat(Bool_t rcuFormat = kFALSE)
{ fIsOldRCUFormat = rcuFormat; };
virtual void SetInput(TTree * tree); // set input tree with digits
- virtual void SetOutput(TTree * tree); //set output tree with
+ virtual void SetOutput(TTree * tree); // set output tree with
+ virtual void FillRow(); // fill the output container - Tree or TObjArray
+ TObjArray * GetOutputArray(){return fOutputArray;}
private:
Bool_t IsMaximum(Float_t k, Int_t max, const Float_t *bins) const;
void MakeCluster2(Int_t k,Int_t max,Float_t *bins,UInt_t m,
UInt_t fEventType; // Event Type
TTree * fInput; //!input tree with digits - object not owner
TTree * fOutput; //!output tree with digits - object not owner
+ TObjArray *fOutputArray; //! output TObjArray with pointers arrays of cluster
AliTPCClustersRow * fRowCl; //! current cluster row
AliSimDigits * fRowDig; //! current digits row
const AliTPCParam * fParam; //! tpc parameters