fDigits = 0 ;
fEmcRecPoints = 0 ;
fPpsdRecPoints = 0 ;
- fCpvRecPoints = 0 ;
fTrackSegments = 0 ;
fRecParticles = 0 ;
fDigits = 0 ;
fEmcRecPoints = 0 ;
fPpsdRecPoints = 0 ;
- fCpvRecPoints = 0 ;
fTrackSegments = 0 ;
fRecParticles = 0 ;
if(fPpsdRecPoints)
fPpsdRecPoints->Delete() ;
delete fPpsdRecPoints ;
- if(fCpvRecPoints)
- fCpvRecPoints->Delete() ;
- delete fCpvRecPoints ;
if(fTrackSegments)
fTrackSegments->Delete() ;
delete fTrackSegments ;
if (branch) branch->SetAddress(&fPpsdRecPoints) ;
}
- //Branch address for TreeR: CPVRecPoint
- if(fCpvRecPoints)
- fCpvRecPoints->Delete();
- else
- fCpvRecPoints = new AliPHOSRecPoint::RecPointsList(1) ;
-
- if ( treeR && fCpvRecPoints ) {
- branch = treeR->GetBranch("PHOSCpvRP");
- if (branch) branch->SetAddress(&fCpvRecPoints) ;
- }
-
//Branch address for TreeR: TrackSegments
if(fTrackSegments)
fTrackSegments->Clear() ;
// to be redefined when ppsd is present
return & fPpsdRecPoints ;
}
- virtual AliPHOSRecPoint::RecPointsList ** CpvRecPoints() {
- // to be redefined when cpv is present
- return & fCpvRecPoints ;
- }
virtual void SetTreeAddress();
virtual AliPHOSRecParticle::RecParticlesList ** RecParticles() {
// Getting list of RecParticles
AliPHOSRecPoint::RecPointsList *fEmcRecPoints ; // The RecPoints (clusters) list in EMC
AliPHOSRecPoint::RecPointsList *fPpsdRecPoints ;// The RecPoints (clusters) list in PPSD (veto)
- AliPHOSRecPoint::RecPointsList *fCpvRecPoints ; // The RecPoints (clusters) list in CPV (veto)
AliPHOSTrackSegment::TrackSegmentsList *fTrackSegments ;// The TrackSegment list in PHOS
AliPHOSRecParticle::RecParticlesList *fRecParticles ; // The reconstructed particles list in PHOS
else if (strcmp(fGeom->GetName(),"IHEP") == 0 || strcmp(fGeom->GetName(),"MIXT") == 0) {
fClu->SetLocalMaxCutCPV(0.03) ;
fClu->SetLogWeightCutCPV(4.0) ;
- fClu->SetCpvEnergyThreshold(0.09) ;
+ fClu->SetCpvEnergyThreshold(0.2) ;
}
fClu->SetCalibrationParameters(0., 0.00000001) ;
//========== Creates the track segment maker
fTrs = new AliPHOSTrackSegmentMakerv1() ;
- // fTrs->UnsetUnfoldFlag() ;
+ // fTrs->UnsetUnfoldFlag() ;
- //========== Creates the particle identifier for GPS2 only
- if (strcmp(fGeom->GetName(),"GPS2") == 0 || strcmp(fGeom->GetName(),"MIXT") == 0) {
- fPID = new AliPHOSPIDv1() ;
- fPID->SetShowerProfileCuts(0.3, 1.8, 0.3, 1.8 ) ;
- }
+ //========== Creates the particle identifier
+ fPID = new AliPHOSPIDv1() ;
+ fPID->SetShowerProfileCuts(0.3, 1.8, 0.3, 1.8 ) ;
//========== Creates the Reconstructioner
fRec = new AliPHOSReconstructioner(fClu, fTrs, fPID) ;
if (fDebugLevel != 0) fRec -> SetDebugReconstruction(kTRUE);
}
-
+
if (fDebugLevel != 0 ||
(ievent+1) % (Int_t)TMath::Power( 10, (Int_t)TMath::Log10(ievent+1) ) == 0)
cout << "======= Analyze ======> Event " << ievent+1 << endl ;
//=========== Connects the various Tree's for evt
Int_t tracks = gAlice->GetEvent(ievent);
-
+
fPHOS->Hit2Digit(tracks) ;
-
+
//=========== Do the reconstruction
fPHOS->Reconstruction(fRec);
-
+
}
if(fClu) {delete fClu ; fClu =0 ;}
//-------------------------------------------------------------------------------------
void AliPHOSAnalyze::ReadAndPrintCPV(Int_t EvFirst, Int_t EvLast)
{
- //
- // Read and print generated and reconstructed hits in CPV
- // for events from EvFirst to Nevent.
- // If only EvFirst is defined, print only this one event.
- // Author: Yuri Kharlov
- // 12 October 2000
- //
-
- if (EvFirst!=0 && EvLast==0) EvLast=EvFirst;
- for ( Int_t ievent=EvFirst; ievent<=EvLast; ievent++) {
+// //
+// // Read and print generated and reconstructed hits in CPV
+// // for events from EvFirst to Nevent.
+// // If only EvFirst is defined, print only this one event.
+// // Author: Yuri Kharlov
+// // 12 October 2000
+// //
+
+// if (EvFirst!=0 && EvLast==0) EvLast=EvFirst;
+// for ( Int_t ievent=EvFirst; ievent<=EvLast; ievent++) {
- //========== Event Number>
- cout << endl << "==== ReadAndPrintCPV ====> Event is " << ievent+1 << endl ;
+// //========== Event Number>
+// cout << endl << "==== ReadAndPrintCPV ====> Event is " << ievent+1 << endl ;
- //=========== Connects the various Tree's for evt
- Int_t ntracks = gAlice->GetEvent(ievent);
+// //=========== Connects the various Tree's for evt
+// Int_t ntracks = gAlice->GetEvent(ievent);
- //========== Creating branches ===================================
- AliPHOSRecPoint::RecPointsList ** emcRecPoints = fPHOS->EmcRecPoints() ;
- gAlice->TreeR()->SetBranchAddress( "PHOSEmcRP" , emcRecPoints ) ;
+// //========== Creating branches ===================================
+// AliPHOSRecPoint::RecPointsList ** emcRecPoints = fPHOS->EmcRecPoints() ;
+// gAlice->TreeR()->SetBranchAddress( "PHOSEmcRP" , emcRecPoints ) ;
- AliPHOSRecPoint::RecPointsList ** cpvRecPoints = fPHOS->CpvRecPoints() ;
- gAlice->TreeR()->SetBranchAddress( "PHOSCpvRP", cpvRecPoints ) ;
+// AliPHOSRecPoint::RecPointsList ** cpvRecPoints = fPHOS->PpsdRecPoints() ;
+// gAlice->TreeR()->SetBranchAddress( "PHOSPpsdRP", cpvRecPoints ) ;
- // Read and print CPV hits
+// // Read and print CPV hits
- AliPHOSCPVModule cpvModule;
- TClonesArray *cpvHits;
- Int_t nCPVhits;
- AliPHOSCPVHit *cpvHit;
- TLorentzVector p;
- Float_t xgen, zgen;
- Int_t ipart;
- Int_t nGenHits = 0;
- for (Int_t itrack=0; itrack<ntracks; itrack++) {
- //=========== Get the Hits Tree for the Primary track itrack
- gAlice->ResetHits();
- gAlice->TreeH()->GetEvent(itrack);
- Int_t iModule = 0 ;
- for (iModule=0; iModule < fGeom->GetNCPVModules(); iModule++) {
- cpvModule = fPHOS->GetCPVModule(iModule);
- cpvHits = cpvModule.Hits();
- nCPVhits = cpvHits->GetEntriesFast();
- for (Int_t ihit=0; ihit<nCPVhits; ihit++) {
- nGenHits++;
- cpvHit = (AliPHOSCPVHit*)cpvHits->UncheckedAt(ihit);
- p = cpvHit->GetMomentum();
- xgen = cpvHit->X();
- zgen = cpvHit->Y();
- ipart = cpvHit->GetIpart();
- printf("CPV hit in module %d: ",iModule+1);
- printf(" p = (%f, %f, %f, %f) GeV,\n",
- p.Px(),p.Py(),p.Pz(),p.Energy());
- printf(" (X,Z) = (%8.4f, %8.4f) cm, ipart = %d\n",
- xgen,zgen,ipart);
- }
- }
- }
-
- // Read and print CPV reconstructed points
-
- //=========== Gets the Reconstruction TTree
- gAlice->TreeR()->GetEvent(0) ;
- printf("Recpoints: %d\n",(*fPHOS->CpvRecPoints())->GetEntries());
- TIter nextRP(*fPHOS->CpvRecPoints() ) ;
- AliPHOSCpvRecPoint *cpvRecPoint ;
- Int_t nRecPoints = 0;
- while( ( cpvRecPoint = (AliPHOSCpvRecPoint *)nextRP() ) ) {
- nRecPoints++;
- TVector3 locpos;
- cpvRecPoint->GetLocalPosition(locpos);
- Int_t phosModule = cpvRecPoint->GetPHOSMod();
- printf("CPV recpoint in module %d: (X,Z) = (%f,%f) cm\n",
- phosModule,locpos.X(),locpos.Z());
- }
- printf("This event has %d generated hits and %d reconstructed points\n",
- nGenHits,nRecPoints);
- }
+// AliPHOSCPVModule cpvModule;
+// TClonesArray *cpvHits;
+// Int_t nCPVhits;
+// AliPHOSCPVHit *cpvHit;
+// TLorentzVector p;
+// Float_t xgen, zgen;
+// Int_t ipart;
+// Int_t nGenHits = 0;
+// for (Int_t itrack=0; itrack<ntracks; itrack++) {
+// //=========== Get the Hits Tree for the Primary track itrack
+// gAlice->ResetHits();
+// gAlice->TreeH()->GetEvent(itrack);
+// Int_t iModule = 0 ;
+// for (iModule=0; iModule < fGeom->GetNCPVModules(); iModule++) {
+// cpvModule = fPHOS->GetCPVModule(iModule);
+// cpvHits = cpvModule.Hits();
+// nCPVhits = cpvHits->GetEntriesFast();
+// for (Int_t ihit=0; ihit<nCPVhits; ihit++) {
+// nGenHits++;
+// cpvHit = (AliPHOSCPVHit*)cpvHits->UncheckedAt(ihit);
+// p = cpvHit->GetMomentum();
+// xgen = cpvHit->X();
+// zgen = cpvHit->Y();
+// ipart = cpvHit->GetIpart();
+// printf("CPV hit in module %d: ",iModule+1);
+// printf(" p = (%f, %f, %f, %f) GeV,\n",
+// p.Px(),p.Py(),p.Pz(),p.Energy());
+// printf(" (X,Z) = (%8.4f, %8.4f) cm, ipart = %d\n",
+// xgen,zgen,ipart);
+// }
+// }
+// }
+
+// // Read and print CPV reconstructed points
+
+// //=========== Gets the Reconstruction TTree
+// gAlice->TreeR()->GetEvent(0) ;
+// printf("Recpoints: %d\n",(*fPHOS->CpvRecPoints())->GetEntries());
+// TIter nextRP(*fPHOS->CpvRecPoints() ) ;
+// AliPHOSCpvRecPoint *cpvRecPoint ;
+// Int_t nRecPoints = 0;
+// while( ( cpvRecPoint = (AliPHOSCpvRecPoint *)nextRP() ) ) {
+// nRecPoints++;
+// TVector3 locpos;
+// cpvRecPoint->GetLocalPosition(locpos);
+// Int_t phosModule = cpvRecPoint->GetPHOSMod();
+// printf("CPV recpoint in module %d: (X,Z) = (%f,%f) cm\n",
+// phosModule,locpos.X(),locpos.Z());
+// }
+// printf("This event has %d generated hits and %d reconstructed points\n",
+// nGenHits,nRecPoints);
+// }
}
//____________________________________________________________________________
virtual void MakeClusters(const DigitsList * dl,
AliPHOSRecPoint::RecPointsList * emccl,
- AliPHOSRecPoint::RecPointsList * ppsdl,
- AliPHOSRecPoint::RecPointsList * cpvl) = 0 ;
+ AliPHOSRecPoint::RecPointsList * ppsdl) = 0 ;
virtual void PrintParameters() = 0 ;
virtual void SetCalibrationParameters(Float_t A, Float_t B) = 0 ;
virtual void SetEmcClusteringThreshold(Float_t cluth) = 0 ;
while ( (digit = (AliPHOSDigit *)next()) ) {
-// cout << " clusterizerv1 " << endl ;
-// int nprim = digit->GetNprimary() ;
-// int * aprim = digit->GetPrimary() ;
-// for ( int ii = 0 ; ii < nprim ; ii++)
-// cout << ii << " prim = " << aprim[ii] << endl ;
-
Int_t id = digit->GetId() ;
Float_t ene = Calibrate(digit->GetAmp()) ;
fGeom->AbsToRelNumbering(id, relid) ;
//____________________________________________________________________________
Bool_t AliPHOSClusterizerv1::IsInPpsd(AliPHOSDigit * digit)
{
- // Tells if (true) or not (false) the digit is in a PHOS-EMC module
+ // Tells if (true) or not (false) the digit is in a PHOS-PPSD module
Bool_t rv = kFALSE ;
//____________________________________________________________________________
Bool_t AliPHOSClusterizerv1::IsInCpv(AliPHOSDigit * digit)
{
- // Tells if (true) or not (false) the digit is in a PHOS-EMC module
+ // Tells if (true) or not (false) the digit is in a PHOS-CPV module
Bool_t rv = kFALSE ;
//____________________________________________________________________________
void AliPHOSClusterizerv1::MakeClusters(const DigitsList * dl,
AliPHOSRecPoint::RecPointsList * emcl,
- AliPHOSRecPoint::RecPointsList * ppsdl,
- AliPHOSRecPoint::RecPointsList * cpvl)
+ AliPHOSRecPoint::RecPointsList * ppsdl)
{
// Steering method to construct the clusters stored in a list of Reconstructed Points
// A cluster is defined as a list of neighbour digits
} else {
- // start a new PPSD cluster
+ // start a new PPSD/CPV cluster
if(fNumberOfPpsdClusters >= ppsdl->GetSize()) ppsdl->Expand(2*fNumberOfPpsdClusters+1);
- if(fNumberOfCpvClusters >= cpvl ->GetSize()) cpvl ->Expand(2*fNumberOfCpvClusters +1);
- if (IsInPpsd(digit)) {
+ if (IsInPpsd(digit))
(*ppsdl)[fNumberOfPpsdClusters] = new AliPHOSPpsdRecPoint() ;
- clu = (AliPHOSPpsdRecPoint *) ppsdl->At(fNumberOfPpsdClusters) ;
- fNumberOfPpsdClusters++ ;
- }
- else if (IsInCpv(digit) ) {
- (*cpvl) [fNumberOfCpvClusters] = new AliPHOSCpvRecPoint(fW0CPV, fLocMaxCutCPV) ;
- clu = (AliPHOSCpvRecPoint *) cpvl ->At(fNumberOfCpvClusters) ;
- fNumberOfCpvClusters++ ;
- }
- else {
- cout << "AliPHOSClusterizerv1::MakeClusters: unknown configuration " << fGeom->GetName() << endl;
- assert(0==1);
- }
+ else
+ (*ppsdl)[fNumberOfPpsdClusters] = new AliPHOSCpvRecPoint(fW0CPV, fLocMaxCutCPV) ;
+ clu = (AliPHOSPpsdRecPoint *) ppsdl->At(fNumberOfPpsdClusters) ;
+ fNumberOfPpsdClusters++ ;
+
clu->AddDigit(*digit, Calibrate(digit->GetAmp()) ) ;
clusterdigitslist[iDigitInCluster] = digit ;
iDigitInCluster++ ;
nextdigit.Reset() ;
// Here we remove resting EMC digits, which cannot make cluster
-
+
if( notremoved ) {
while( ( digit = (AliPHOSDigit *)nextdigit() ) ) {
if( IsInEmc(digit) )
} // else
nextdigit.Reset() ;
-
+
AliPHOSDigit * digitN ;
index = 0 ;
while (index < iDigitInCluster){ // scan over digits already in cluster
} // switch
} // while digitN
-
+
endofloop: ;
nextdigit.Reset() ;
virtual Bool_t IsInCpv (AliPHOSDigit * digit) ; // Tells if id digit is in CPV
virtual void MakeClusters(const DigitsList * dl,
AliPHOSRecPoint::RecPointsList * emcl,
- AliPHOSRecPoint::RecPointsList * ppsdl,
- AliPHOSRecPoint::RecPointsList * cpvl) ; // does the job
+ AliPHOSRecPoint::RecPointsList * ppsdl) ; // does the job
virtual void PrintParameters() ;
virtual void SetCalibrationParameters(Float_t A,Float_t B){ fA = A ; fB = B;}
virtual void SetEmcClusteringThreshold(Float_t cluth) { fEmcClusteringThreshold = cluth ; }
return fAmp ; }
void GetLocalPosition(TVector3 &Lpos) ; // computes the position in the PHOS module
void GetClusterLengths(Int_t &lengX, Int_t &lengZ); // cluster lengths along x and z
+ Bool_t IsEmc(void) {
+ // tells that this is not a EMC
+ return kFALSE ;
+ }
Bool_t IsCPV(void) {
// true if the recpoint is in CPV
return (fPHOSMod <= ((AliPHOSGeometry*) fGeom)->GetNCPVModules()) ; }
return TMath::Sqrt(d) ;
}
+//______________________________________________________________________________
+Float_t AliPHOSEmcRecPoint::CoreEnergy()
+{
+ //This function calculates energy in the core,
+ //i.e. within radius rad = 3cm. Beyond this radius
+ //in accoradnce with shower profile energy deposition
+ // should be less than 2%
+
+ AliPHOSIndexToObject * please = AliPHOSIndexToObject::GetInstance() ;
+
+ Float_t eCore = 0 ;
+ Float_t coreRadius = 3 ;
+
+ TVector3 locpos;
+ GetLocalPosition(locpos);
+ Float_t x = locpos.X() ;
+ Float_t z = locpos.Z() ;
+
+ AliPHOSDigit * digit ;
+ AliPHOSGeometry * phosgeom = (AliPHOSGeometry *) fGeom ;
+
+ Int_t iDigit;
+ for(iDigit=0; iDigit < fMulDigit; iDigit++) {
+ digit = (AliPHOSDigit *) ( please->GimeDigit(fDigitsList[iDigit]) ) ;
+ Int_t relid[4] ;
+ Float_t xi ;
+ Float_t zi ;
+ phosgeom->AbsToRelNumbering(digit->GetId(), relid) ;
+ phosgeom->RelPosInModule(relid, xi, zi);
+ Float_t distance = TMath::Sqrt((xi-x)*(xi-x)+(zi-z)*(zi-z)) ;
+ if(distance < coreRadius)
+ eCore += fEnergyList[iDigit] ;
+ }
+
+return eCore ;
+}
//____________________________________________________________________________
void AliPHOSEmcRecPoint::GetElipsAxis(Float_t * lambda)
virtual void AddDigit(AliPHOSDigit & digit, Float_t Energy) ; // add a digit to the digits list
Int_t Compare(TObject * obj) ; // method for sorting
+ Float_t CoreEnergy() ;
Float_t GetDelta (){
// gets the fDelta data member
Int_t pcdetector ; // 1 hit and 0 no hit
while ( (tracksegment = (AliPHOSTrackSegment *)next()) ) {
- Int_t module = tracksegment->GetPHOSMod();
- cout << "PHOS module: " << module << endl;
- if ( module <= fGeom->GetNCPVModules()) continue;
new( (*rpl)[index] ) AliPHOSRecParticle(tracksegment) ;
rp = (AliPHOSRecParticle *)rpl->At(index) ;
AliPHOSEmcRecPoint * recp = tracksegment->GetEmcRecPoint() ;
AliPHOSPpsdRecPoint * rpcpv = tracksegment->GetPpsdUpRecPoint() ;
AliPHOSPpsdRecPoint * rppc = tracksegment->GetPpsdLowRecPoint() ;
-
-// Float_t * lambda = new Float_t[2];
-// recp->GetElipsAxis(lambda) ;
-
-// // Looking at the lateral development of the shower
-// if ( ( lambda[0] > fLambda1m && lambda[0] < fLambda1M ) && // shower profile cut
-// ( lambda[1] > fLambda2m && lambda[1] < fLambda2M ) )
-// // Float_t R ;
-// //R=(lambda[0]-1.386)*(lambda[0]-1.386)+1.707*1.707*(lambda[1]-1.008)*(lambda[1]-1.008) ;
-// //if(R<0.35*0.35)
+
+ // Float_t * lambda = new Float_t[2];
+ // recp->GetElipsAxis(lambda) ;
+
+ // // Looking at the lateral development of the shower
+ // if ( ( lambda[0] > fLambda1m && lambda[0] < fLambda1M ) && // shower profile cut
+ // ( lambda[1] > fLambda2m && lambda[1] < fLambda2M ) )
+ // // Float_t R ;
+ // //R=(lambda[0]-1.386)*(lambda[0]-1.386)+1.707*1.707*(lambda[1]-1.008)*(lambda[1]-1.008) ;
+ // //if(R<0.35*0.35)
Float_t Dispersion;
Dispersion = recp->GetDispersion();
showerprofile = 0 ; // NARROW PROFILE
else
showerprofile = 1 ;// WIDE PROFILE
-
-
+
+
// Looking at the photon conversion detector
if( tracksegment->GetPpsdLowRecPoint() == 0 )
pcdetector = 0 ; // No hit
else
pcdetector = 0 ;
}
-
+
// Looking at the photon conversion detector
if( tracksegment->GetPpsdUpRecPoint() == 0 )
cpvdetector = 0 ; // No hit
void AliPHOSReconstructioner::Make(DigitsList * dl,
AliPHOSRecPoint::RecPointsList * emccl,
AliPHOSRecPoint::RecPointsList * ppsdl,
- AliPHOSRecPoint::RecPointsList * cpvcl,
AliPHOSTrackSegment::TrackSegmentsList * trsl,
AliPHOSRecParticle::RecParticlesList * rpl)
{
if (fDebugReconstruction)
cout << "\n\nDebugReconstruction>>> " << "Start making reconstructed points (clusterizing!!)" << endl;
- fClusterizer->MakeClusters(dl, emccl, ppsdl, cpvcl);
+ fClusterizer->MakeClusters(dl, emccl, ppsdl);
if (fDebugReconstruction){
cout << "DebugReconstruction>>> " << "AliPHOSReconstructioner: Digit list entries is " << dl->GetEntries() << endl ;
if (fDebugReconstruction) cout << "DebugReconstruction>>>> Start making track segments(unfolding+tracksegments)" << endl;
- fTrackSegmentMaker->MakeTrackSegments(dl, emccl, ppsdl, cpvcl, trsl) ;
+ fTrackSegmentMaker->MakeTrackSegments(dl, emccl, ppsdl, trsl) ;
// mark the position of the TrackSegments in the array
AliPHOSTrackSegment * trs ;
}
if (fDebugReconstruction) cout << "DebugReconstruction>>>> Start making reconstructed particles" << endl;
-
+
if (fPID) {
fPID->MakeParticles(trsl, rpl) ;
void Make(TClonesArray * DL,
AliPHOSRecPoint::RecPointsList * emccl,
AliPHOSRecPoint::RecPointsList * ppsdl,
- AliPHOSRecPoint::RecPointsList * cpvl,
AliPHOSTrackSegment::TrackSegmentsList * trsl,
AliPHOSRecParticle::RecParticlesList * rpl) ; // does the job
virtual void MakeTrackSegments(DigitsList * DL,
AliPHOSRecPoint::RecPointsList * emcl,
AliPHOSRecPoint::RecPointsList * ppsdl,
- AliPHOSRecPoint::RecPointsList * cpvl,
AliPHOSTrackSegment::TrackSegmentsList * trsl ) = 0 ; // does the job
virtual void SetMaxEmcPpsdDistance(Float_t r) = 0 ;
virtual void SetUnfoldFlag() = 0 ;
ppsdRecPoint = (AliPHOSPpsdRecPoint *) ppsdIn->At(index) ;
if(ppsdRecPoint->GetPHOSMod() != phosmod )
break ;
- if(ppsdRecPoint->GetUp() )
+ if(phosmod <= fGeom->GetNCPVModules()) //in CPV
ppsdOutUp->AddAt(index,inPpsdUp++) ;
- else
- ppsdOutLow->AddAt(index,inPpsdLow++) ;
+ else{ //in PPSD
+ if(ppsdRecPoint->GetUp() )
+ ppsdOutUp->AddAt(index,inPpsdUp++) ;
+ else
+ ppsdOutLow->AddAt(index,inPpsdLow++) ;
+ }
}
ppsdOutLow->Set(inPpsdLow);
ppsdOutUp->Set(inPpsdUp);
void AliPHOSTrackSegmentMakerv1::MakeTrackSegments(DigitsList * dl,
AliPHOSRecPoint::RecPointsList * emcl,
AliPHOSRecPoint::RecPointsList * ppsdl,
- AliPHOSRecPoint::RecPointsList * cpvl,
AliPHOSTrackSegment::TrackSegmentsList * trsl)
{
// Makes the track segments out of the list of EMC and PPSD Recpoints and stores them in a list
if(fUnfoldFlag){
UnfoldAll(dl, emcl) ; // Unfolds all EMC clusters
- UnfoldAll(dl, cpvl) ; // Unfolds all CPV clusters
+ UnfoldAll(dl, ppsdl) ; // Unfolds all CPV clusters
}
- Int_t phosmod = fGeom->GetNCPVModules() + 1 ;
+ Int_t phosmod = 1 ;
while(phosmod <= fGeom->GetNModules() ){
FillOneModule(emcl, emcRecPoints, ppsdl, ppsdRecPointsUp, ppsdRecPointsLow, phosmod, emcStopedAt, ppsdStopedAt) ;
//____________________________________________________________________________
void AliPHOSTrackSegmentMakerv1::UnfoldAll(DigitsList * dl, AliPHOSRecPoint::RecPointsList * emcIn)
{
- // Performs unfolding of all EMC clusters, sorts them and resets indexes in RecPoints
+ // Performs unfolding of all EMC/CPV but NOT ppsd clusters, sorts them and resets indexes in RecPoints
AliPHOSEmcRecPoint * emcRecPoint ;
Int_t index ;
Int_t nEmcUnfolded = emcIn->GetEntries() ;
-
- for(index = 0 ; index < nEmcUnfolded; index++){
- emcRecPoint = (AliPHOSEmcRecPoint *) emcIn->At(index) ;
-
- Int_t nMultipl = emcRecPoint->GetMultiplicity() ;
- Int_t * maxAt = new Int_t[nMultipl] ;
- Float_t * maxAtEnergy = new Float_t[nMultipl] ;
- Int_t nMax = emcRecPoint->GetNumberOfLocalMax(maxAt, maxAtEnergy) ;
-
- if( nMax > 1 ) { // if cluster is very flat (no pronounced maximum) then nMax = 0
- UnfoldClusters(dl, emcIn, emcRecPoint, nMax, maxAt, maxAtEnergy) ;
- emcIn->Remove(emcRecPoint);
- emcIn->Compress() ;
- index-- ;
- nEmcUnfolded-- ;
- }
-
- delete[] maxAt ;
- delete[] maxAtEnergy ;
- } //Unfolding finished
+ Int_t nModulesToUnfold ;
- emcIn->Sort() ;
+ if(emcIn->GetEntries() > 0){
- // to set index to new and correct index of old RecPoints
- for( index = 0 ; index < emcIn->GetEntries() ; index++){
+ if(((AliPHOSRecPoint *)emcIn->At(0))->IsEmc())
+ nModulesToUnfold = fGeom->GetNModules() ;
+ else
+ nModulesToUnfold = fGeom->GetNCPVModules() ;
+
+ for(index = 0 ; index < nEmcUnfolded; index++){
+
+ emcRecPoint = (AliPHOSEmcRecPoint *) emcIn->At(index) ;
+ if(emcRecPoint->GetPHOSMod()> nModulesToUnfold)
+ break ;
+
+ Int_t nMultipl = emcRecPoint->GetMultiplicity() ;
+ Int_t * maxAt = new Int_t[nMultipl] ;
+ Float_t * maxAtEnergy = new Float_t[nMultipl] ;
+ Int_t nMax = emcRecPoint->GetNumberOfLocalMax(maxAt, maxAtEnergy) ;
+
+ if( nMax > 1 ) { // if cluster is very flat (no pronounced maximum) then nMax = 0
+ UnfoldClusters(dl, emcIn, emcRecPoint, nMax, maxAt, maxAtEnergy) ;
+ emcIn->Remove(emcRecPoint);
+ emcIn->Compress() ;
+ index-- ;
+ nEmcUnfolded-- ;
+ }
+
+ delete[] maxAt ;
+ delete[] maxAtEnergy ;
+ } //Unfolding finished
- ((AliPHOSEmcRecPoint *) emcIn->At(index))->SetIndexInList(index) ;
+ emcIn->Sort() ;
+ // to set index to new and correct index of old RecPoints
+ for( index = 0 ; index < emcIn->GetEntries() ; index++){
+
+ ((AliPHOSEmcRecPoint *) emcIn->At(index))->SetIndexInList(index) ;
+
+ }
+
+ emcIn->Sort() ;
}
- emcIn->Sort() ;
-
}
//____________________________________________________________________________
void AliPHOSTrackSegmentMakerv1::UnfoldClusters(DigitsList * dl,
void MakeTrackSegments(DigitsList * DL,
AliPHOSRecPoint::RecPointsList * emcl,
AliPHOSRecPoint::RecPointsList * ppsdl,
- AliPHOSRecPoint::RecPointsList * cpvl,
AliPHOSTrackSegment::TrackSegmentsList * trsl ) ; // does the job
virtual void MakeTrackSegmentsCPV(DigitsList * DL,
AliPHOSRecPoint::RecPointsList * emcl,
delete fPpsdRecPoints ;
fPpsdRecPoints = 0 ;
}
-
- if ( fCpvRecPoints ) {
- fCpvRecPoints->Delete() ;
- delete fCpvRecPoints ;
- fCpvRecPoints = 0 ;
- }
-
+
if ( fTrackSegments ) {
fTrackSegments->Delete() ;
delete fTrackSegments ;
gAlice->TreeR()->Branch(branchname, "TObjArray", &fPpsdRecPoints, fBufferSize, splitlevel) ;
}
- fCpvRecPoints->Delete() ;
-
- if ( fCpvRecPoints && gAlice->TreeR() ) {
- sprintf(branchname,"%sCpvRP",GetName()) ;
- gAlice->TreeR()->Branch(branchname, "TObjArray", &fCpvRecPoints, fBufferSize, splitlevel) ;
- }
-
fTrackSegments->Delete() ;
if ( fTrackSegments && gAlice->TreeR() ) {
fRecParticles->Delete() ;
- if (strcmp(fGeom->GetName(),"GPS2") == 0 || strcmp(fGeom->GetName(),"MIXT") == 0) {
- if ( fRecParticles && gAlice->TreeR() ) {
- sprintf(branchname,"%sRP",GetName()) ;
- gAlice->TreeR()->Branch(branchname, &fRecParticles, fBufferSize) ;
- }
+ if ( fRecParticles && gAlice->TreeR() ) {
+ sprintf(branchname,"%sRP",GetName()) ;
+ gAlice->TreeR()->Branch(branchname, &fRecParticles, fBufferSize) ;
}
// 3.
- fReconstructioner->Make(fDigits, fEmcRecPoints, fPpsdRecPoints,
- fCpvRecPoints, fTrackSegments, fRecParticles);
+ fReconstructioner->Make(fDigits, fEmcRecPoints, fPpsdRecPoints, fTrackSegments, fRecParticles);
- printf("Reconstruction: %d %d %d %d %d\n",
- fEmcRecPoints->GetEntries(),fPpsdRecPoints->GetEntries(),fCpvRecPoints->GetEntries(),
+ printf("Reconstruction: %d %d %d %d\n",
+ fEmcRecPoints->GetEntries(),fPpsdRecPoints->GetEntries(),
fTrackSegments->GetEntries(),fRecParticles->GetEntries());
// 4. Expand or Shrink the arrays to the proper size
size = fPpsdRecPoints->GetEntries() ;
fPpsdRecPoints->Expand(size) ;
- size = fCpvRecPoints->GetEntries() ;
- fCpvRecPoints->Expand(size) ;
-
size = fTrackSegments->GetEntries() ;
fTrackSegments->Expand(size) ;
if ( fEmcRecPoints ) fEmcRecPoints ->Delete();
if ( fPpsdRecPoints ) fPpsdRecPoints->Delete();
- if ( fCpvRecPoints ) fCpvRecPoints ->Delete();
if ( fTrackSegments ) fTrackSegments->Delete();
if ( fRecParticles ) fRecParticles ->Delete();
if ( xyze[3] != 0 ) { // there is deposited energy
gMC->CurrentVolOffID(5, relid[0]) ; // get the PHOS Module number
- if ( name == "MIXT" && strcmp(gMC->CurrentVolOffName(5),"PHO1") == 0 )
+ if ( name == "MIXT" && strcmp(gMC->CurrentVolOffName(5),"PHO1") == 0 ){
relid[0] += fGeom->GetNModules() - fGeom->GetNPPSDModules();
+ }
gMC->CurrentVolOffID(3, relid[1]) ; // get the Micromegas Module number
// 1-> fGeom->GetNumberOfModulesPhi() * fGeom->GetNumberOfModulesZ() upper
// > fGeom->GetNumberOfModulesPhi() * fGeom->GetNumberOfModulesZ() lower
Int_t moduleNumber;
gMC->CurrentVolOffID(10,moduleNumber);
+
if ( name == "MIXT" && strcmp(gMC->CurrentVolOffName(10),"PHO1") == 0 )
moduleNumber += fGeom->GetNModules() - fGeom->GetNPPSDModules();
moduleNumber--;
if ( xyze[3] != 0 ) {
gMC->CurrentVolOffID(10, relid[0]) ; // get the PHOS module number ;
- if ( name == "MIXT" && strcmp(gMC->CurrentVolOffName(5),"PHO1") == 0 )
- relid[0] += fGeom->GetNModules() - fGeom->GetNPPSDModules();
+ if ( name == "MIXT" && strcmp(gMC->CurrentVolOffName(10),"PHO1") == 0 )
+ relid[0] += fGeom->GetNModules() - fGeom->GetNPPSDModules();
+
relid[1] = 0 ; // means PBW04
gMC->CurrentVolOffID(4, relid[2]) ; // get the row number inside the module
gMC->CurrentVolOffID(3, relid[3]) ; // get the cell number inside the module
// get the absolute Id number
-
fGeom->RelToAbsNumbering(relid, absid) ;
// add current hit to the hit list
-
AddHit(fIshunt, primary,tracknumber, absid, xyze, trackpid);
} // there is deposited energy