- SECTOR segmentation (number of sectors is flexible).
- Introduction of the AliITSUPixelModule container for clustering purposes.
# SHLIBS - Shared Libraries and objects for linking (Executables only) #
#--------------------------------------------------------------------------------#
-set ( SRCS UPGRADE/AliITSlayerUpgrade.cxx UPGRADE/AliITStrackerUpgrade.cxx UPGRADE/AliITStrackU.cxx UPGRADE/AliITStrackerU.cxx UPGRADE/AliITSUpgradeReconstructor.cxx UPGRADE/AliITSUpgradeClusterList.cxx UPGRADE/AliITSUpgradeClusterListNode.cxx UPGRADE/AliITSUpgradeClusterFinder.cxx)
+set ( SRCS UPGRADE/AliITSlayerUpgrade.cxx UPGRADE/AliITStrackerUpgrade.cxx UPGRADE/AliITStrackU.cxx UPGRADE/AliITStrackerU.cxx UPGRADE/AliITSUpgradeReconstructor.cxx UPGRADE/AliITSUpgradeClusterList.cxx UPGRADE/AliITSUpgradeClusterListNode.cxx UPGRADE/AliITSUPixelModule.cxx UPGRADE/AliITSUpgradeClusterFinder.cxx)
string ( REPLACE ".cxx" ".h" HDRS "${SRCS}" )
#pragma link C++ class AliITSUpgradeReconstructor+;
#pragma link C++ class AliITSUpgradeClusterList+;
#pragma link C++ class AliITSUpgradeClusterListNode+;
+#pragma link C++ class AliITSUPixelModule+;
#pragma link C++ class AliITSUpgradeClusterFinder+;
#endif
fPixId(9999),
fSignal(0),
fNLayer(0),
+ fModule(0),
fNelectrons(0)
{for(Int_t i=0; i<3 ; i++) fSignalID[i]=-1;} //default creator
//_______________________________________________________________________
AliITSDigitUpgrade::AliITSDigitUpgrade(Int_t *digits): AliDigit(digits),
fPixId(9999),
fSignal(0),
- fNLayer(0),
+ fNLayer(0),
+ fModule(0),
fNelectrons(0)
{for(Int_t i=0; i<3 ; i++) fSignalID[i]=-1;} //standard creator digits only
//____________________________________________________________________________________________________
fPixId(pixid),
fSignal(eloss),
fNLayer(0),
+ fModule(0),
fNelectrons(0)
{for(Int_t i=0; i<3 ; i++) fSignalID[i]=-1;} //standard creator digits only
//____________________________________________________________________________________________________
fPixId(d.fPixId),
fSignal(d.fSignal),
fNLayer(d.fNLayer),
+ fModule(d.fModule),
fNelectrons(d.fNelectrons)
{for(Int_t i=0; i<3 ; i++) fSignalID[i]=d.fSignalID[i];} //copy constructor
//____________________________________________________________________________________________________
GetPosition(fNLayer,GetxPixelNumber(),GetzPixelNumber(),xz[0],xz[1]);
printf("pixid %10.0i (%6.3f,%6.3f) in layer %i \n",(Int_t)fPixId,xz[0],xz[1],fNLayer);
+ printf("pixid %u ",(UInt_t)fPixId);
+ printf(" (xloc, zloc)= (%6.3f, %6.3f) in layer %i and module %i \n",xz[0],xz[1],fNLayer, fModule);
printf(" Eloss %f Nel %f track ID %i %i %i ", fSignal, fNelectrons,fTracks[0],fTracks[1],fTracks[2]);
printf(" ElossID %f %f %f \n", fSignalID[0],fSignalID[1],fSignalID[2]);
}
void SetSignal(Float_t sig) {fSignal = sig;}
void SetLayer(Int_t layer) {fNLayer = layer;}
+ void SetModule(Int_t module) {fModule = module ;}
void SetNelectrons(Double_t nele) {fNelectrons = nele;}
void SetTrackID(Int_t tid) {fTracks[0]=tid;}
void SetPixId(ULong_t nx, ULong_t nz) {fPixId = 100000*nx + nz ;}
Float_t GetSignal() const {return fSignal;}
Int_t GetLayer() const {return fNLayer;}
+ Int_t GetModule() const {return fModule;}
Double_t GetNelectrons() const {return fNelectrons;}
ULong_t GetPixId(){return fPixId;}
Int_t GetxPixelNumber() const {return fPixId/100000;}
ULong_t fPixId;
Float_t fSignal; // Signal as Eloss in the medium
Int_t fNLayer;
+ Int_t fModule;
Double_t fNelectrons;
Float_t fSignalID[3];
{
// Arguments: pObj - pointer to object to compare with
// Returns: -1 if AbsPad less then in pObj, 1 if more and 0 if they are the same
- if (fPixId==((AliITSDigitUpgrade*)pObj)->GetPixId()) return 0;
- else if(fPixId >((AliITSDigitUpgrade*)pObj)->GetPixId()) return 1;
+
+ if (fModule>((AliITSDigitUpgrade*)pObj)->GetModule())return 1;
+
+ else if(fModule==((AliITSDigitUpgrade*)pObj)->GetModule()){
+ if (fPixId==((AliITSDigitUpgrade*)pObj)->GetPixId()) return 0;
+ else if(fPixId >((AliITSDigitUpgrade*)pObj)->GetPixId()) return 1;
+ }
else return -1;
}
ClassImp(AliITSRecPointU)
//_____________________________________________________________
AliITSRecPointU::AliITSRecPointU():
- AliITSRecPoint()
+ AliITSRecPoint(),
+ fModule(0)
{
//
// Default constructor
}
//_____________________________________________________________
AliITSRecPointU::AliITSRecPointU(const AliITSRecPointU& pt):
- AliITSRecPoint(pt)
+ AliITSRecPoint(pt),
+ fModule(pt.fModule)
{
//
// Copy constructor
AliITSRecPointU& operator=(const AliITSRecPointU &source);
void SetLocalCoord(Float_t x, Float_t z) {fXloc=x; fZloc=z;}
+ void SetModule(Int_t i){fModule=i;}
+ Int_t GetModule(){return fModule;}
+
+ protected:
+ Int_t fModule;
ClassDef(AliITSRecPointU,1) // AliITSRecPointU class
--- /dev/null
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * *
+ * Author: The ALICE Off-line Project. *
+ * Contributors are mentioned in the code where appropriate. *
+ * *
+ * Permission to use, copy, modify and distribute this software and its *
+ * documentation strictly for non-commercial purposes is hereby granted *
+ * without fee, provided that the above copyright notice appears in all *
+ * copies and that both the copyright notice and this permission notice *
+ * appear in the supporting documentation. The authors make no claims *
+ * about the suitability of this software for any purpose. It is *
+ * provided "as is" without express or implied warranty. *
+ **************************************************************************/
+////////////////////////////////////////////////////////////////////////////
+// //
+// Base Class used to find //
+// the reconstructed points for ITS Upgrade //
+// //
+////////////////////////////////////////////////////////////////////////////
+
+
+#include "AliITSUPixelModule.h"
+
+
+AliITSUPixelModule::AliITSUPixelModule():
+ TObject(),
+ fCharge(0),
+ fModule(0),
+ fCol(0),
+ fRow(0)
+{
+ //
+ // Default constructor
+ //
+ for(Int_t i=0;i<3;i++)fLabels[i]=-1;
+}
+//_______________________________________________
+AliITSUPixelModule::AliITSUPixelModule( UShort_t mod, UInt_t col, UInt_t row, UInt_t charge, Int_t lab[3]):
+ TObject(),
+ fCharge(charge),
+ fModule(mod),
+ fCol(col),
+ fRow(row)
+{
+ //
+ // Constructor
+ //
+ for(Int_t i=0;i<3;i++)fLabels[i]=lab[i];
+}
+//____________________________________________
+void AliITSUPixelModule::SetLabels(Int_t lab[3]){
+ // Setter for cluster labels
+ for(Int_t i=0;i<3;i++)fLabels[i]=lab[i];
+}
+//_______________________________________________
+void AliITSUPixelModule::PrintInfo(){
+ //
+ // printout method for debugging
+ //
+ printf(" module %d col %i row %i charge %i label %i, %i, %i \n", fModule, fCol, fRow,fCharge, fLabels[0], fLabels[1], fLabels[2]);
+}
+
+
+
--- /dev/null
+#ifndef ALIITSUPIXELMODULE_H
+#define ALIITSUPIXELMODULE_H
+
+
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice */
+
+
+////////////////////////////////////////////////
+// ITS Cluster Finder Module Container //
+// Used in the ClusterFinder to keep //
+// clusters in one module before storing //
+// them in treeR //
+////////////////////////////////////////////////
+
+#include <TObject.h>
+
+class AliITSUPixelModule :public TObject {
+
+ public :
+
+ AliITSUPixelModule();
+ AliITSUPixelModule( UShort_t module, UInt_t col, UInt_t row, UInt_t charge, Int_t lab[3]);
+
+ virtual ~AliITSUPixelModule(){;}
+
+ void SetPixelCoord( UInt_t col, UInt_t row) {fCol = col ; fRow = row; }
+ void SetLabels(Int_t lab[3]);
+ void SetCharge(UInt_t charge) {fCharge = charge;}
+
+ UShort_t GetModule() const {return fModule; }
+ UInt_t GetCol() const {return fCol; }
+ UInt_t GetRow() const {return fRow; }
+ UInt_t GetCharge() const {return fCharge;}
+ Int_t GetLabels(Int_t i) const {return fLabels[i];}
+ void PrintInfo();
+
+ protected:
+ UInt_t fCharge;
+ UShort_t fModule;
+ UInt_t fCol;
+ UInt_t fRow;
+ Int_t fLabels[3];
+
+
+ AliITSUPixelModule(const AliITSUPixelModule &p); // copy constructor
+ AliITSUPixelModule& operator=(const AliITSUPixelModule &p); // assignment operator
+
+
+ ClassDef(AliITSUPixelModule,0)
+
+ };
+#endif
+
#include "AliITSRecPointU.h"
#include "AliITSDigitUpgrade.h"
#include "AliITSRawStreamSPD.h"
+#include "AliITSUPixelModule.h"
#include "AliLog.h"
#include <string.h>
#include <TObjString.h>
fClusterWidthMinCol(0),
fClusterWidthMaxRow(0),
fClusterWidthMinRow(0),
+ fClusterList(0x0),
fChargeArray(0x0),
fRecPoints(0x0),
- fNlayers()
+ fNSectors()
{
//
// Default constructor
//
AliITSsegmentationUpgrade *s = new AliITSsegmentationUpgrade();
- fNlayers = s->GetNLayers();
+ fNSectors = s->GetNSectors();
delete s;
-
+ fClusterList = new AliITSUpgradeClusterList*[fNSectors];
+ for(Int_t imod =0; imod < fNSectors; imod++){
+ fClusterList[imod] = new AliITSUpgradeClusterList();
+}
+
fChargeArray = new TObjArray();
fChargeArray->SetOwner(kTRUE);
fRecPoints = new TClonesArray("AliITSRecPointU",3000);
AliITSUpgradeClusterFinder::~AliITSUpgradeClusterFinder() {
if(fChargeArray) delete fChargeArray;
if(fRecPoints) delete fRecPoints;
+ if(fClusterList)delete [] fClusterList;
}
//___________________________________________________________________________________
void AliITSUpgradeClusterFinder::StartEvent() {
NewEvent();
}
//___________________________________________________________________________________
-Int_t AliITSUpgradeClusterFinder::ProcessHit(Int_t layer , UInt_t col, UInt_t row, UShort_t charge, Int_t label[3]) {
+Int_t AliITSUpgradeClusterFinder::ProcessHit(Int_t module , UInt_t col, UInt_t row, UShort_t charge, Int_t label[3]) {
//
// Adds one pixel to the cluster
//
-
- if (layer>=fNlayers) {
- printf("ERROR: UpgradeClusterFinder::ProcessHit: Out of bounds: layer ,col,row, charge, label(0,1,2)= %d,%d,%d,%d,(%d,%d,%d)\n",layer ,col,row,charge,label[0],label[1],label[2]);
+ AliDebug(2,Form("module,col,row,charge,label(0,1,2) = %d,%d,%d,%d,(%d,%d,%d)\n",module ,col,row,charge,label[0],label[1],label[2]));
+ if (module>=fNSectors) {
+ AliError(Form("Out of bounds: module ,col,row, charge, label(0,1,2)= %d,%d,%d,%d,(%d,%d,%d)\n",module ,col,row,charge,label[0],label[1],label[2]));
return 1;
}
-
// do we need to perform clustering on previous module?
- if (fOldModule!=-1 && (Int_t)layer!=fOldModule) {
- fChargeArray->AddLast(new TObjString(Form("%i %i %i %i %i %i",col,row,charge,label[0],label[1],label[2])));
+ if (fOldModule!=-1 && (Int_t)module!=fOldModule) {
+ //fChargeArray->AddLast(new TObjString(Form("%i %i %i %i %i %i",col,row,charge,label[0],label[1],label[2])));
+ AliITSUPixelModule *pix = new AliITSUPixelModule(module,col, row, charge, label);
+ fChargeArray->AddLast(pix);
+
DoModuleClustering(fOldModule,charge);
NewModule();
}
// add hit
- fChargeArray->AddLast(new TObjString(Form("%i %i %i %i %i %i",col,row,charge,label[0],label[1],label[2])));
+ AliITSUPixelModule *pix = new AliITSUPixelModule(module,col, row, charge, label);
+ fChargeArray->AddLast(pix);
+// fChargeArray->AddLast(new TObjString(Form("%i %i %i %i %i %i",col,row,charge,label[0],label[1],label[2])));
- fOldModule=layer;
+ fOldModule=module;
fHitCol[fNhitsLeft]=col;
fHitRow[fNhitsLeft]=row;
fHits[col][row]=kTRUE;
}
}
//___________________________________________________________________________________
-UInt_t AliITSUpgradeClusterFinder::GetClusterCount(Int_t layer) const {
+UInt_t AliITSUpgradeClusterFinder::GetClusterCount(Int_t module) const {
//
- // number of clusters in the layer
+ // number of clusters in the module
//
- if (layer>=fNlayers ) {
- printf("ERROR: UpgradeClusterFinder::GetClusterCount: Module out of bounds: layer = %d\n",layer);
+ if (module>fNSectors ) {
+ printf("ERROR: UpgradeClusterFinder::GetClusterCount: Module out of bounds: module = %d\n",module);
return 0;
}
- return fClusterList[layer].GetNrEntries();
+ return fClusterList[module]->GetNrEntries();
}
//___________________________________________________________________________________
-Float_t AliITSUpgradeClusterFinder::GetClusterMeanCol(Int_t layer, UInt_t index) {
+Float_t AliITSUpgradeClusterFinder::GetClusterMeanCol(Int_t module, UInt_t index) {
//
// cluster position in terms of colums : mean column ID
//
- if (layer>=fNlayers) {
- printf("ERROR: UpgradeClusterFinder::GetClusterMeanCol: Module out of bounds: layer = %d\n",layer);
+ if (module>=fNSectors) {
+ printf("ERROR: UpgradeClusterFinder::GetClusterMeanCol: Module out of bounds: module = %d\n",module);
return 0;
}
- return fClusterList[layer].GetColIndex(index);
+ return fClusterList[module]->GetColIndex(index);
}
//___________________________________________________________________________________
-Float_t AliITSUpgradeClusterFinder::GetClusterMeanRow(Int_t layer, UInt_t index) {
+Float_t AliITSUpgradeClusterFinder::GetClusterMeanRow(Int_t module, UInt_t index) {
//
// cluster position in terms of rows : mean row ID
//
- if (layer>=fNlayers) {
- printf("ERROR: UpgradeClusterFinder::GetClusterMeanRow: Module out of bounds: layer = %d\n",layer);
+ if (module>=fNSectors) {
+ printf("ERROR: UpgradeClusterFinder::GetClusterMeanRow: Module out of bounds: module = %d\n",module);
return 0;
}
- return fClusterList[layer].GetRowIndex(index);
+ return fClusterList[module]->GetRowIndex(index);
}
//___________________________________________________________________________________
-UInt_t AliITSUpgradeClusterFinder::GetClusterSize(Int_t layer, UInt_t index) {
+UInt_t AliITSUpgradeClusterFinder::GetClusterSize(Int_t module, UInt_t index) {
//
// total number of pixels of the cluster
//
- if (layer>=fNlayers) {
- printf("ERROR: UpgradeClusterFinder::GetClusterSize: Module out of bounds: layer = %d\n",layer);
+ if (module>=fNSectors) {
+ printf("ERROR: UpgradeClusterFinder::GetClusterSize: Module out of bounds: module = %d\n",module);
return 0;
}
- return fClusterList[layer].GetSizeIndex(index);
+ return fClusterList[module]->GetSizeIndex(index);
}
//___________________________________________________________________________________
-UInt_t AliITSUpgradeClusterFinder::GetClusterWidthZ(Int_t layer, UInt_t index) {
+UInt_t AliITSUpgradeClusterFinder::GetClusterWidthZ(Int_t module, UInt_t index) {
//
// # pixels of the cluster in Z direction
//
- if (layer>=fNlayers) {
- printf("ERROR: UpgradeClusterFinder::GetClusterWidthZ: Module out of bounds: layer = %d\n",layer);
+ if (module>=fNSectors) {
+ printf("ERROR: UpgradeClusterFinder::GetClusterWidthZ: Module out of bounds: module = %d\n",module);
return 0;
}
- return fClusterList[layer].GetWidthZIndex(index);
+ return fClusterList[module]->GetWidthZIndex(index);
}
//___________________________________________________________________________________
-UInt_t AliITSUpgradeClusterFinder::GetClusterWidthPhi(Int_t layer, UInt_t index) {
+UInt_t AliITSUpgradeClusterFinder::GetClusterWidthPhi(Int_t module, UInt_t index) {
//
// # pixels of the cluster in phi direction (XY plane)
//
- if (layer>=fNlayers) {
- printf("ERROR: UpgradeClusterFinder::GetClusterWidthPhi: Module out of bounds: layer = %d\n",layer);
+ if (module>=fNSectors) {
+ printf("ERROR: UpgradeClusterFinder::GetClusterWidthPhi: Module out of bounds: module = %d\n",module);
return 0;
}
- return fClusterList[layer].GetWidthPhiIndex(index);
+ return fClusterList[module]->GetWidthPhiIndex(index);
}
//___________________________________________________________________________________
-UInt_t AliITSUpgradeClusterFinder::GetClusterType(Int_t layer, UInt_t index) {
+UInt_t AliITSUpgradeClusterFinder::GetClusterType(Int_t module, UInt_t index) {
//
// cluster shape
//
- if (layer>=fNlayers) {
- printf("ERROR: UpgradeClusterFinder::GetClusterType: Module out of bounds: layer = %d\n",layer);
+ if (module>=fNSectors) {
+ printf("ERROR: UpgradeClusterFinder::GetClusterType: Module out of bounds: layer = %d\n",module);
return 0;
}
- return fClusterList[layer].GetTypeIndex(index);
+ return fClusterList[module]->GetTypeIndex(index);
}
//___________________________________________________________________________________
void AliITSUpgradeClusterFinder::PrintAllClusters() {
// printout of the cluster information
//
- for (Int_t layer=0; layer<fNlayers; layer++) {
- PrintClusters(layer);
+ for (Int_t module=0; module<fNSectors; module++) {
+ PrintClusters(module);
}
}
//___________________________________________________________________________________
-void AliITSUpgradeClusterFinder::PrintClusters(Int_t layer) {
+void AliITSUpgradeClusterFinder::PrintClusters(Int_t module) {
//
// printout of the cluster information
//
- if (layer>=fNlayers) {
- printf("ERROR: UpgradeClusterFinder::PrintClusters: Out of bounds: layer = %d\n",layer);
+ if (module>=fNSectors) {
+ printf("ERROR: UpgradeClusterFinder::PrintClusters: Out of bounds: layer = %d\n",module);
return;
}
- if(fClusterList[layer].GetNrEntries()==0) {
+ if(fClusterList[module]->GetNrEntries()==0) {
printf("no cluster list entries. Exiting... \n");
return;
}
- for (UInt_t c=0; c<fClusterList[layer].GetNrEntries(); c++) {
- printf("layer %d , z,y=%f,%f , size=%d , type=%d labels=%d %d %d (label printout to be implemented...)\n",layer,fClusterList[layer].GetColIndex(c),fClusterList[layer].GetRowIndex(c),fClusterList[layer].GetSizeIndex(c),fClusterList[layer].GetTypeIndex(c),999,999,999);
- }
+ // for (UInt_t c=0; c<fClusterList[layer]->GetNrEntries(); c++) {
+ //printf("layer %d , z,y=%f,%f , size=%d , type=%d labels=%d %d %d (label printout to be implemented...)\n",layer,fClusterList[layer].GetColIndex(c),fClusterList[layer].GetRowIndex(c),fClusterList[layer].GetSizeIndex(c),fClusterList[layer].GetTypeIndex(c),999,999,999);
+ // }
}
//___________________________________________________________________________________
void AliITSUpgradeClusterFinder::NewEvent() {
// Cleaning up and preparation for the clustering procedure
//
- for (Int_t i=0; i<fNlayers; i++) {
- fClusterList[i].Clear();
- }
- NewModule();
+ for (Int_t i=0; i<fNSectors; i++) {
+ fClusterList[i]->Clear();
+ }
+ //NewModule();
fOldModule = -1;
}
//___________________________________________________________________________________
fChargeArray->Clear();
}
//___________________________________________________________________________________
-Int_t AliITSUpgradeClusterFinder::DoModuleClustering(Int_t Layer, UShort_t charge) {
+Int_t AliITSUpgradeClusterFinder::DoModuleClustering(Int_t module, UShort_t charge) {
//
// Clustering and cluster-list container filling
//
memset(fClusterTypeArea,0,kMAXCLUSTERTYPESIDEZ*kMAXCLUSTERTYPESIDEY*sizeof(Bool_t));
fColSum=0;
fRowSum=0;
- UInt_t size = FindClusterRecu(fClusterTypeOrigCol,fClusterTypeOrigRow,charge);
+ UInt_t size = FindClusterRecu(fClusterTypeOrigCol,fClusterTypeOrigRow,charge);
if(size==1){
fCharge=GetPixelCharge(fColSum,fRowSum);
AddLabelIndex(fColSum,fRowSum);
}
if (size>0) {
if(size>1) AliDebug(2,Form("DoModuleClustering, size %i , labels : %i %i %i \n",size,fLabels[0],fLabels[1],fLabels[2]));
- fClusterList[Layer].Insert((Float_t)fColSum/size, (Float_t)fRowSum/size, size, GetClusterWidthZ(), GetClusterWidthPhi(), GetClusterType(size), fCharge,fLabels);
+ fClusterList[module]->Insert((Float_t)fColSum/size, (Float_t)fRowSum/size, size, GetClusterWidthZ(), GetClusterWidthPhi(), GetClusterType(size), fCharge,fLabels);
fCharge=0;
for(Int_t i=0; i<10; i++) fLabels[i]=-5;
}
}
}
//___________________________________________________________________________________
-UShort_t AliITSUpgradeClusterFinder::GetCharge(Int_t layer,UInt_t index ) {
- return fClusterList[layer].GetCharge(index);
+UShort_t AliITSUpgradeClusterFinder::GetCharge(Int_t module,UInt_t index ) {
+ return fClusterList[module]->GetCharge(index);
}
//___________________________________________________________________________________
-Int_t * AliITSUpgradeClusterFinder::GetLabels(Int_t layer,UInt_t index) {
- return fClusterList[layer].GetLabels(index);
+Int_t * AliITSUpgradeClusterFinder::GetLabels(Int_t module,UInt_t index) {
+ return fClusterList[module]->GetLabels(index);
}
//___________________________________________________________________________________
//...self explaining
//
Int_t q=0;
+ //AliInfo(Form(" entrate charge array %i ", fChargeArray->GetEntries()));
for(Int_t entry =0; entry < fChargeArray->GetEntries(); entry++){
- TObjString *s = (TObjString*)fChargeArray->At(entry);
+/* TObjString *s = (TObjString*)fChargeArray->At(entry);
TString name = s->GetString();
if(!name.Contains(Form("%i %i",col,row)))
continue;
+ AliInfo(Form(" 1 entry %i ", entry));
TObjArray *array = name.Tokenize(" ");
+ array->SetOwner(kTRUE);
+ AliInfo(Form(" 2 entry %i ", entry));
TString charge = ((TObjString*)array->At(2))->String();
+
TString rowS, colS;
rowS = ((TObjString*)array->At(0))->String();
colS = ((TObjString*)array->At(1))->String();
+ AliInfo(Form(" 3 prima del delete entry %i ", entry));
+ array->Clear();
delete array;
+ AliInfo(Form(" 4 dopo il delete entry %i ", entry));
q=charge.Atoi();
- return q;
+*/
+ AliITSUPixelModule *pixMod = (AliITSUPixelModule*)fChargeArray->At(entry);
+ // pixMod->PrintInfo();
+ if(col!=pixMod->GetCol())continue;
+ if(row!=pixMod->GetRow())continue;
+ q= pixMod->GetCharge();
- }
+ }
return q;
}
//____________________________________________________
//
for(Int_t entry =0; entry < fChargeArray->GetEntries(); entry++){
- TObjString *s = (TObjString*)fChargeArray->At(entry);
+/* TObjString *s = (TObjString*)fChargeArray->At(entry);
TString name = s->GetString();
if(!name.Contains(Form("%i %i",col,row)))
continue;
label[i]=index[i].Atoi();
}
+*/
+ AliITSUPixelModule *pix= (AliITSUPixelModule*)fChargeArray->At(entry);
+ if(col!=pix->GetCol())continue;
+ if(row!=pix->GetRow())continue;
+ Int_t label[3]={-1,-1,-1};
+ for(Int_t i=0;i<3;i++){
+ label[i] = pix->GetLabels(i);
+ }
SetLabels(label);
- delete array;
}
}
//____________________________________________________
AliITSRecPointU recpnt;
Int_t nClusters =0;
TClonesArray &lrecp = *fRecPoints;
-
- for(Int_t ilayer=0; ilayer < fNlayers ;ilayer ++){
+ for(Int_t ilayer=0; ilayer < 6 ;ilayer ++){
+ NewModule();
TClonesArray *pArrDig= (TClonesArray*)digList->At(ilayer);
- StartEvent();
- AliDebug(1,Form("layer %i : # digits %i",ilayer,pArrDig->GetEntries()));
+ StartEvent();
+ pArrDig->Sort();
+
for(Int_t ientr =0; ientr < pArrDig->GetEntries() ; ientr++){
AliITSDigitUpgrade *dig = (AliITSDigitUpgrade*)pArrDig->At(ientr);
Int_t colz=dig->GetzPixelNumber();
Int_t rowx=dig->GetxPixelNumber();
Double_t hitcharge= (dig->GetNelectrons());
-
- ProcessHit(ilayer,colz, rowx,(Short_t)hitcharge,dig->GetTracks());
+ ProcessHit(dig->GetModule(),colz, rowx,(Short_t)hitcharge,dig->GetTracks());
}//ientr
FinishEvent();
-
- for(UInt_t nClu = 0; nClu < GetClusterCount(ilayer); nClu++){
- UShort_t charge = GetCharge(ilayer, nClu);
+ for(Int_t module=0; module<fNSectors; module++){
+
+ // printf(" module loop %i \n", module);
+ for(UInt_t nClu = 0; nClu < GetClusterCount(module); nClu++){
+ //printf(" nclu in getclustercount %i \n", nClu);
+ UShort_t charge = GetCharge(module, nClu);
recpnt.SetQ(charge);
recpnt.SetLayer(ilayer);
- Int_t *lab=GetLabels(ilayer,nClu);
+ recpnt.SetModule(module);
+ Int_t *lab=GetLabels(module,nClu);
for(Int_t l=0; l<3; l++) {recpnt.SetLabel(lab[l],l);}
- Bool_t check2;
- Double_t xcheck2=0.;
- Double_t ycheck2=0.;
- Double_t zcheck2=0.;
+ //Bool_t check2;
+ //Double_t xcheck2=0.;
+ //Double_t ycheck2=0.;
+ //Double_t zcheck2=0.;
Double_t xzl2[2]={0.,0.};
Double_t xPixC2,zPixC2=0.;
- xPixC2 = GetClusterMeanRow(ilayer, nClu);
- zPixC2 = GetClusterMeanCol(ilayer, nClu);
+ xPixC2 = GetClusterMeanRow(module, nClu);
+ zPixC2 = GetClusterMeanCol(module, nClu);
+ //cout << "zPixC2 "<< zPixC2 << endl;
xzl2[0] = xPixC2*(segmentation->GetCellSizeX(ilayer))+0.5*(segmentation-> GetCellSizeX(ilayer));
- xzl2[1] = zPixC2*(segmentation->GetCellSizeZ(ilayer))+0.5*(segmentation->GetCellSizeZ(ilayer))-(segmentation->GetHalfLength(ilayer));
- check2 = segmentation->DetToGlobal(ilayer,xzl2[0], xzl2[1],xcheck2,ycheck2,zcheck2);
- recpnt.SetType(GetClusterType(ilayer,nClu ));
+ xzl2[1] = zPixC2*(segmentation->GetCellSizeZ(ilayer))+0.5*(segmentation->GetCellSizeZ(ilayer))-(segmentation->GetHalfLength(ilayer));
+ //cout << " vediamo che positione ha il recpoint !!!! zl = "<< xzl2[1] << endl;
+ //check2 = segmentation->DetToGlobal(ilayer,xzl2[0], xzl2[1],xcheck2,ycheck2,zcheck2);
+ recpnt.SetType(GetClusterType(module,nClu ));
recpnt.SetLocalCoord(xzl2[0],xzl2[1]); //temporary solution (no LocalToTrack Matrix)
//from global to tracking system coordinate
// global coordinate -> local coordinate getting alpha angle of the recpoint
- Float_t xclg = xcheck2;//upgrade clusters global coordinate ( ITS official: GetX tracking coordinate)
- Float_t yclg = ycheck2;
- Float_t zclg = zcheck2;
- Double_t phiclu1rad, phiclu1deg;
- phiclu1rad=TMath::ATan2(yclg,xclg);//cluster phi angle (rad)
- if (phiclu1rad<0) phiclu1rad+=TMath::TwoPi();//from 0 to 360
- else if (phiclu1rad>=TMath::TwoPi()) phiclu1rad-=TMath::TwoPi();//
-
- phiclu1deg=180.*phiclu1rad/TMath::Pi();// in deg
- Int_t ladder;// virtual segmentation starting from the cluster phi
-
- ladder=(Int_t)phiclu1deg/18;// in which ladder the cluster is
- Double_t alpha= (ladder*18.+9.)*TMath::Pi()/180.;//angle at the center of the ladder (rad)
-
- //alpha rotation
- Float_t xclu1Tr = xclg*TMath::Cos(alpha)-yclg*TMath::Sin(alpha);
- Float_t yclu1 = yclg*TMath::Cos(alpha)+xclg*TMath::Sin(alpha);
- Float_t xclu1 = TMath::Sqrt(xclu1Tr*xclu1Tr+yclu1*yclu1);
- Float_t zclu1 = zclg;
- Double_t phiTrk= (phiclu1rad-alpha);// cluster angle in the rotated system (rad)
-
- yclu1=xclu1*phiTrk; // tracking system coordinate: r*phi
+ /////
+ Double_t yclu1 = 0.;//upgrade clusters global coordinate ( ITS official: GetX tracking coordinate)
+ Double_t zclu1 = 0.;//upgrade clusters global coordinate ( ITS official: GetX tracking coordinate)
+ // Float_t xclg = xcheck2;//upgrade clusters global coordinate ( ITS official: GetX tracking coordinate)
+ // Float_t yclg = ycheck2;
+ // Float_t zclg = zcheck2;
+ Bool_t detr=kFALSE;
+ detr = segmentation->DetToTrack(ilayer,module, xzl2[0],xzl2[1], yclu1, zclu1);
+// printf( " det to track in clusterfinder il %i xl %f zl %f y track %f z track %f module %i \n", ilayer, xzl2[0] , xzl2[1] , yclu1, zclu1, module);
+
+//////////////////////////
recpnt.SetX(0.);
recpnt.SetY(yclu1);
recpnt.SetZ(zclu1);
-
+
+
Double_t xsize, zsize;
segmentation->GetSegmentation(ilayer,xsize, zsize);
recpnt.SetSigmaY2(xsize/TMath::Sqrt(12)*xsize/TMath::Sqrt(12));
new(lrecp[nClusters++]) AliITSRecPointU(recpnt);
//Int_t idx = fRecPoints->GetEntries();
AliDebug(1,Form("recpoint : Nelectrons %f (entry %i)",recpnt.GetQ(),fRecPoints->GetEntries()));
- }//cluster list entries
+
+ }//cluster list entries
+ }//module
}//ilayer
if(segmentation) delete segmentation;
}
UShort_t fClusterWidthMaxRow; //max row ID of the cluster
UShort_t fClusterWidthMinRow; //min row ID of the cluster
Bool_t fClusterTypeArea[kMAXCLUSTERTYPESIDEZ][kMAXCLUSTERTYPESIDEY];// same as above comments
- AliITSUpgradeClusterList fClusterList[8]; // cluster container
+ AliITSUpgradeClusterList **fClusterList; //[fNSectors] cluster container
TObjArray *fChargeArray; // charge identifier
TClonesArray *fRecPoints; // used to fill treeR
- Int_t fNlayers;//number of layer in ITSUpgrade
-
+ Int_t fNSectors;
AliITSUpgradeClusterFinder(const AliITSUpgradeClusterFinder &source); // copy constructor
// assignment operator
AliITSUpgradeClusterFinder& operator=(const AliITSUpgradeClusterFinder &source);
//_____________________________________________________________________________
- AliITSsegmentationUpgrade::AliITSsegmentationUpgrade(): TObject(),
+ AliITSsegmentationUpgrade::AliITSsegmentationUpgrade():
+TObject(),
fCellSizeX(0),
fCellSizeZ(0),
+ fNSectors(0),
fMinRadius(0),
fMaxRadius(0),
fHalfLength(0)
TFile *f=TFile::Open("Segmentation.root");
TArrayD *x=0;
TArrayD *z=0;
+ TArrayD *nS=0;
+
if(!f){
AliError("Segmentation not available");
return;
}else {
x=(TArrayD*)f->Get("CellSizeX");
z=(TArrayD*)f->Get("CellSizeZ");
+ nS=(TArrayD*)f->Get("nSectors");
}
f->Close();
AliInfo(Form("the volume %s has not been found... exiting!",Form("LayerSilicon%i",i)));
return;
}
+
TGeoTube *shape = (TGeoTube*)vol->GetShape();
if(!shape) {
AliInfo(Form("the volume %s has not shape defined... exiting!",vol->GetName()));
return;
}
-
+ // AliInfo(Form(" volume index %i ", i));
// setting the geometry parameters (needed for trasformations Global-Local)
fMaxRadius.Set(i+1); fMaxRadius.AddAt(shape->GetRmax(),i);
fMinRadius.Set(i+1); fMinRadius.AddAt(shape->GetRmin(),i);
fCellSizeZ.AddAt(z->At(i),i);
i++;
}
+ fNSectors = (Int_t)(nS->At(0));
+
}
//_______________________________________________________________
-AliITSsegmentationUpgrade::AliITSsegmentationUpgrade(TArrayD radii, TArrayD widths, TArrayD Length): TObject(),
+AliITSsegmentationUpgrade::AliITSsegmentationUpgrade(TArrayD radii, TArrayD widths, TArrayD Length):
+TObject(),
fCellSizeX(0),
fCellSizeZ(0),
+ fNSectors(110),
fMinRadius(0),
fMaxRadius(0),
fHalfLength(0)
zsize =fCellSizeZ.At(ilayer);
}
//_____________________________________________________________________________
-Bool_t AliITSsegmentationUpgrade::GlobalToDet(Int_t ilayer, Double_t x,Double_t y,Double_t z,Double_t &xl,Double_t &zl) {
+Bool_t AliITSsegmentationUpgrade::GlobalToDet(Int_t ilayer, Double_t x,Double_t y,Double_t z,Double_t &xl,Double_t &zl) const{
if(TMath::Abs(z)>fHalfLength.At(ilayer)) return kFALSE;
x = fMaxRadius.At(ilayer)*TMath::Cos(alpha);
y = fMaxRadius.At(ilayer)*TMath::Sin(alpha);
- Int_t layer=0;
- layer=ilayer;
return kTRUE;
}
//_______________________________________________________________________________
}
+//__________________________________________________________________________________
+Bool_t AliITSsegmentationUpgrade::DetToGlobal(Int_t ilayer, Int_t module, Double_t xl,Double_t zl,Double_t &x,Double_t &y, Double_t &z) const {
+if(module<0){ DetToGlobal(ilayer,xl,zl, x, y, z);
+return kTRUE;
+}
+
+ if(TMath::Abs(z)>fHalfLength.At(ilayer)) return kFALSE;
+ z = zl;
+ Double_t alpha = (xl+module*(fMaxRadius.At(ilayer)*((TMath::Pi()*2)/fNSectors)))/fMaxRadius.At(ilayer);
+
+
+ x = fMaxRadius.At(ilayer)*TMath::Cos(alpha);
+ y = fMaxRadius.At(ilayer)*TMath::Sin(alpha);
+
+return kTRUE;
+}
+//_______________________________________________________________________________________________
+Bool_t AliITSsegmentationUpgrade::GlobalToDet(Int_t ilayer, Double_t x,Double_t y,Double_t z,Double_t &xl,Double_t &zl,Int_t &module) const {
+ if(module<0){
+ GlobalToDet(ilayer,x,y,z, xl, zl);
+ return kTRUE;
+ }
+
+ if(TMath::Abs(z)>fHalfLength.At(ilayer)) return kFALSE;
+
+ zl = z;
+
+ Double_t xyproj= TMath::Sqrt(x*x+y*y);
+ if(xyproj==0 || xyproj-0.001 > fMaxRadius.At(ilayer)){
+return kFALSE;
+ }
+ Double_t alpha= TMath::ATan2(y,x);
+ if(x>0 && y<0)alpha=alpha+2.*(TMath::Pi());
+ if(x<0 && y<0)alpha=alpha+2.*(TMath::Pi());
+
+ module = (Int_t)(alpha*(fNSectors/(TMath::Pi()*2)));
+ Double_t alphaSect= module*((TMath::Pi()*2)/fNSectors);
+ xl = xyproj*(alpha-alphaSect);//with respect the module
+ //AliInfo(Form(" globtodet con modulo x,y,z = %f, %f, %f, alpha %f module %i alpha del modulo %f xlocal %f xlocal rispettp al modulo %f ", x,y,z,alpha,module, alphaSect, xyproj*alpha, xl));
+ return kTRUE;
+}
+//____________________________________________________________________________________________________
+Bool_t AliITSsegmentationUpgrade::DetToPixID(Double_t xl, Double_t zl,Int_t layer, Int_t &nx, Int_t &nz) const {
+
+ if(xl>fMaxRadius.At(layer)*(TMath::Pi()*2/fNSectors))return kFALSE;
+ if(TMath::Abs(zl)>fHalfLength.At(layer)) return kFALSE;
+
+ nx=(Int_t)(xl/fCellSizeX.At(layer));
+ //printf(" half %f \n ", fHalfLength.At(layer));
+ nz=(Int_t)((zl+fHalfLength.At(layer))/fCellSizeZ.At(layer));
+ return kTRUE;
+}
+//_________________________________________________________________________________________________________
+Bool_t AliITSsegmentationUpgrade::DetToTrack2(Int_t layer,Int_t module, Double_t xl,Double_t zl, Double_t &ytr, Double_t &ztr)const {
+ //sistema di tracciamento la x=0, y è la rphi rispetto al centro del modulo
+ //sistema locale è la y=0 x è rphi rispetto all'inizio del modulo
+
+ //voglio andare dalle locali alle tracciamento
+ Double_t x=0.;
+ Double_t y=0.;
+ Double_t z=0.;
+// printf( " det to track xl %f zl %f \n ", xl, zl);
+ ztr = zl;
+ Bool_t ch=kFALSE;
+ ch=DetToGlobal(layer,module,xl,zl,x,y,z);
+ Double_t radius =fMaxRadius.At(layer);
+ Double_t phiGrad;
+ phiGrad=TMath::ATan2(y,x);//cluster phi angle (rad)
+ if (phiGrad<0) phiGrad+=TMath::TwoPi();//from 0 to 360
+ else if (phiGrad>=TMath::TwoPi()) phiGrad-=TMath::TwoPi();//
+
+ Double_t alpha= (module*(((TMath::Pi()*2)/fNSectors))+(((TMath::Pi()*2)/fNSectors)/2));//angle at the center of the ladder (rad)
+
+ Double_t phiTrk= (phiGrad-alpha);// cluster angle in the rotated system (rad)
+
+ ytr=radius*phiTrk; // tracking system coordinate: r*phi
+ // AliInfo(Form( " det : x %f | track y %f, zeta %f ", xl, ytr,ztr));
+ return kTRUE;
+}
+//__________________________________________
+Bool_t AliITSsegmentationUpgrade::DetToTrack(Int_t layer,Int_t module, Double_t xl,Double_t zl, Double_t &ytr, Double_t &ztr)const {
+ //sistema di tracciamento la x=0, y è la rphi rispetto al centro del modulo
+ //sistema locale è la y=0 x è rphi rispetto all'inizio del modulo
+
+ //voglio andare dalle locali alle tracciamento
+ ztr = zl;
+ Double_t radius =fMaxRadius.At(layer);
+ Double_t alphaloc = module*(TMath::Pi()*2)/fNSectors; //alpha di riferimento per il modulo locale in rad
+ Double_t xlrif = alphaloc*radius;//xlocale di riferimento per questo modulo
+
+ Double_t xlvera = xlrif + xl; // x locale vera rispetto a tutto il cilindro, per sapere a che angolo sto effettivamente
+
+ Double_t alphaGlob = xlvera/radius; //in rad
+
+//da alpha vera posso ottenereinfo di tracciamento
+
+ Double_t alpha_track= (module*(((TMath::Pi()*2)/fNSectors))+(((TMath::Pi()*2)/fNSectors)/2));//angle at the center of the ladder (rad)
+
+ Double_t phiTrk= (alphaGlob-alpha_track);// cluster angle in the rotated system (rad)
+
+ ytr=radius*phiTrk; // tracking system coordinate: r*phi
+// AliInfo(Form( " det : x %f | track y %f, zeta %f ", xl, ytr,ztr));
+ return kTRUE;
+}
+//_______________________
+Int_t AliITSsegmentationUpgrade::GetModule(Double_t x,Double_t y)const{
+
+
+ Double_t alpha= TMath::ATan2(y,x);
+ if(x>0 && y<0)alpha=alpha+2.*(TMath::Pi());
+ if(x<0 && y<0)alpha=alpha+2.*(TMath::Pi());
+
+return GetModule(alpha);
+}
+//_______________________
+Int_t AliITSsegmentationUpgrade::GetModule(Double_t phi) const {
+//
+// sector corresponding to that phi [0,2Pi]
+//
+
+Int_t module = -1;
+if(phi<0 || phi > TMath::TwoPi()) {
+ AliError(Form("Phi is not within the acceptable range [0,2Pi] %f ",phi));
+ }
+else {
+ module = (Int_t) (phi*((Double_t)fNSectors/(TMath::TwoPi())));
+ }
+
+return module;
+
+}
+//_______________________
+Double_t AliITSsegmentationUpgrade::GetAlpha(Int_t module)const{
+//
+// angle of the sector center
+//
+Double_t angle = TMath::DegToRad()*(360./fNSectors);
+return module*angle+0.5*angle;
+
+}
+
+
// Set Detector Segmentation Parameters
virtual void SetSegmentation(Int_t ilayer, Double_t xsize, Double_t zsize); // x/z size in microns
virtual void SetFullSegmentation(TArrayD xsize, TArrayD zsize); // x/z size in microns
+ virtual void SetNSectors(Int_t nSect) {fNSectors=nSect;}
virtual void GetNpad(Int_t ilayer, Int_t &nx, Int_t &nz);
// Transformation from Geant cm detector center local coordinates
// to detector segmentation/cell coordiantes starting from (0,0).
- Bool_t GlobalToDet(Int_t ilayer, Double_t x,Double_t y,Double_t z,Double_t &xl,Double_t &zl);
+ Bool_t GlobalToDet(Int_t ilayer, Double_t x,Double_t y,Double_t z,Double_t &xl,Double_t &zl) const;
+ Bool_t GlobalToDet(Int_t ilayer, Double_t x,Double_t y,Double_t z,Double_t &xl,Double_t &zl, Int_t &module) const;
+
// Transformation from detector segmentation/cell coordiantes starting
// from (0,0) to Geant cm detector center local coordinates.
Bool_t DetToGlobal(Int_t ilayer, Double_t xl,Double_t zl,Double_t &x,Double_t &y, Double_t &z) const;
-
- //
+ Bool_t DetToGlobal(Int_t ilayer, Int_t module, Double_t xl,Double_t zl,Double_t &x,Double_t &y, Double_t &z) const;
+ Bool_t DetToPixID(Double_t xl, Double_t zl,Int_t layer, Int_t &nx, Int_t &nz) const;
+ Bool_t DetToTrack(Int_t layer,Int_t module, Double_t xl, Double_t zl, Double_t &ytr, Double_t &ztr)const;
+ Bool_t DetToTrack2(Int_t layer,Int_t module, Double_t xl, Double_t zl, Double_t &ytr, Double_t &ztr)const;
+ //
// Get Detector Segmentation Parameters
//
+ Int_t GetIdIndex(Int_t layer, Int_t sector) const {return sector*100 + layer; }
+ Int_t GetLayerFromIdIndex(Int_t id)const {return id%100; }
+ Int_t GetModuleFromIdIndex(Int_t id)const {return id/100; }
+
Double_t GetCellSizeX(Int_t ilayer){return fCellSizeX.At(ilayer);}
Double_t GetCellSizeZ(Int_t ilayer){return fCellSizeZ.At(ilayer);}
Double_t GetHalfLength(Int_t ilayer){return fHalfLength.At(ilayer);}
Double_t GetRadius(Int_t ilayer) {return fMinRadius.At(ilayer);}
-
+ Double_t GetAlpha(Int_t module) const;
+ Int_t GetModule(Double_t phi)const;
+ Int_t GetModule(Double_t x, Double_t y)const;
TArrayD GetFullCellSizeX() {return fCellSizeX;}
TArrayD GetFullCellSizeZ() {return fCellSizeZ;}
// Pixel size in x,z
virtual void GetSegmentation(Int_t ilayer, Double_t &xsize, Double_t &zsize) const;
-
+ Int_t GetNSectors() {return fNSectors;}
// layer thickness
virtual Float_t GetThickness(Int_t ilayer) const {if(ilayer > fMinRadius.GetSize() || ilayer < 0) return -1; else return fMaxRadius.At(ilayer) - fMinRadius.At(ilayer);}
TArrayD fCellSizeX; //Size for each pixel in x -microns
TArrayD fCellSizeZ; //Size for each pixel in z -microns
+ Int_t fNSectors;
TArrayD fMinRadius ; // layer inner radius
TArrayD fMaxRadius ; // layer outer radius
TArrayD fHalfLength ; // layer length
AliITSsegmentationUpgrade(const AliITSsegmentationUpgrade &source);
AliITSsegmentationUpgrade& operator=(const AliITSsegmentationUpgrade &source);
- ClassDef(AliITSsegmentationUpgrade,1) //Segmentation class for Upgrade
+ ClassDef(AliITSsegmentationUpgrade,2) //Segmentation class for Upgrade
};
if(trackMI){
fLab = t.fLab;
fFakeRatio = t.fFakeRatio;
- for(Int_t i=0; i<fNLayers; i++) {
- fClIndex[i]= t.fClIndex[i]; fNy[i]=t.fNy[i]; fNz[i]=t.fNz[i]; fNormQ[i]=t.fNormQ[i]; fNormChi2[i] = t.fNormChi2[i];
- }
+ //for(Int_t i=0; i<fNLayers; i++) {
+ // fClIndex[i]= t.fClIndex[i]; fNy[i]=t.fNy[i]; fNz[i]=t.fNz[i]; fNormQ[i]=t.fNormQ[i]; fNormChi2[i] = t.fNormChi2[i];
+ // }
for(Int_t i=0; i<12; i++) {fDy[i]=t.fDy[i]; fDz[i]=t.fDz[i];
fSigmaY[i]=t.fSigmaY[i]; fSigmaZ[i]=t.fSigmaZ[i]; fSigmaYZ[i]=t.fSigmaYZ[i]; }
}
// get the azimuthal angle of the detector containing the innermost
// cluster of this track (data member fAlpha)
- for(Int_t i=0; i<12; i++) {fDy[i]=0; fDz[i]=0; fSigmaY[i]=0; fSigmaZ[i]=0; fSigmaYZ[i]=0;}
+ for(Int_t i=0; i<fgMaxNLayer; i++) {fDy[i]=0; fDz[i]=0; fSigmaY[i]=0; fSigmaZ[i]=0; fSigmaYZ[i]=0;}
if (alpha<0) alpha+=TMath::TwoPi();
else if (alpha>=TMath::TwoPi()) alpha-=TMath::TwoPi();
Int_t fCluMark[fgMaxNLayer][kMaxNumberOfClustersL]; //indices for cluster used
Int_t fNM[fgMaxNLayer]; //number of marked clusters
- Float_t fDy[12]; //dy in layer
- Float_t fDz[12]; //dz in layer
- Float_t fSigmaY[12]; //sigma y
- Float_t fSigmaZ[12]; //sigma z
- Float_t fSigmaYZ[12]; //covariance of y and z
+ Float_t fDy[fgMaxNLayer]; //dy in layer
+ Float_t fDz[fgMaxNLayer]; //dz in layer
+ Float_t fSigmaY[fgMaxNLayer]; //sigma y
+ Float_t fSigmaZ[fgMaxNLayer]; //sigma z
+ Float_t fSigmaYZ[fgMaxNLayer]; //covariance of y and z
Float_t fNy[fgMaxNLayer]; //expected size of cluster
Float_t fNz[fgMaxNLayer]; //expected size of cluster
#include "AliESDtrack.h"
#include "AliITSVertexer.h"
#include "AliITSclusterTable.h"
-#include "AliITSRecPoint.h"
+#include "AliITSRecPointU.h"
#include "AliITStrackU.h"
#include "AliITStrackerMI.h"
#include "AliITSlayerUpgrade.h"
// Load clusters for tracking
//
- TClonesArray statITSCluster("AliITSRecPoint");
+ TClonesArray statITSCluster("AliITSRecPointU");
TClonesArray *ITSCluster = &statITSCluster;
TBranch* itsClusterBranch=clusTree->GetBranch("ITSRecPoints");
clusTree->GetEvent(0);
Int_t nCluster = ITSCluster->GetEntriesFast();
for(Int_t i=0; i<nCluster; i++){
- AliITSRecPoint *recp = (AliITSRecPoint*)ITSCluster->UncheckedAt(i);
- fLayers[recp->GetLayer()]->InsertCluster(new AliITSRecPoint(*recp));
+ AliITSRecPointU *recp = (AliITSRecPointU*)ITSCluster->UncheckedAt(i);
+ fLayers[recp->GetLayer()]->InsertCluster(new AliITSRecPointU(*recp));
}//loop clusters
SetClusterTree(clusTree);
Int_t idx[12];
Int_t ncl = track->GetITSclusters(idx);
for(Int_t k=0;k<ncl;k++){
- AliITSRecPoint* cll = (AliITSRecPoint*)GetCluster(idx[k]);
+ AliITSRecPointU* cll = (AliITSRecPointU*)GetCluster(idx[k]);
cll->SetBit(kSAflag);
}
}
Int_t idx[12];
Int_t ncl = track->GetITSclusters(idx);
for(Int_t k=0;k<ncl;k++){
- AliITSRecPoint* cll = (AliITSRecPoint*)GetCluster(idx[k]);
+ AliITSRecPointU* cll = (AliITSRecPointU*)GetCluster(idx[k]);
cll->ResetBit(kSAflag);
}
}
for(Int_t i=0;i<fNLayers;i++){
if (!ForceSkippingOfLayer(i)) {
for(Int_t cli=0;cli<fLayers[i]->GetNumberOfClusters();cli++){
- AliITSRecPoint* cls = (AliITSRecPoint*)fLayers[i]->GetCluster(cli);
+ AliITSRecPointU* cls = (AliITSRecPointU*)fLayers[i]->GetCluster(cli);
if(cls->TestBit(kSAflag)==kTRUE) continue; //clusters used by TPC prol.
if(cls->GetQ()==0) continue; //fake clusters dead zones
if(i>1 && cls->GetQ()<=fMinQ) continue; // cut on SDD and SSD cluster charge
}
dmar[i]=0;
if(!fCluLayer[i]){
- fCluLayer[i] = new TClonesArray("AliITSRecPoint",nclusters[i]);
+ fCluLayer[i] = new TClonesArray("AliITSRecPointU",nclusters[i]);
}else{
fCluLayer[i]->Delete();
fCluLayer[i]->Expand(nclusters[i]);
if (!ForceSkippingOfLayer(ilay)){
AliDebug(2,Form("number of clusters in layer %i : %i",ilay,fLayers[ilay]->GetNumberOfClusters()));
for(Int_t cli=0;cli<fLayers[ilay]->GetNumberOfClusters();cli++){
- AliITSRecPoint* cls = (AliITSRecPoint*)fLayers[ilay]->GetCluster(cli);
+ AliITSRecPointU* cls = (AliITSRecPointU*)fLayers[ilay]->GetCluster(cli);
if(cls->TestBit(kSAflag)==kTRUE) continue;
if(cls->GetQ()==0) continue;
Double_t phi=0;Double_t lambda=0;
static Int_t clind[fgMaxNLayer][kMaxClu];
static Int_t clmark[fgMaxNLayer][kMaxClu];
static Int_t end[fgMaxNLayer];
- static AliITSRecPoint *listlayer[fgMaxNLayer][kMaxClu];
+ static AliITSRecPointU *listlayer[fgMaxNLayer][kMaxClu];
for(Int_t k=0;k<fgMaxNLayer; k++)end[k]=0;
for(Int_t i=0;i<fNLayers;i++) {
Int_t lay = (index & 0xf0000000) >> 28;
//Int_t cli = index&0x0fffffff;
//AliITSRecPoint* cl = (AliITSRecPoint*)fLayers[lay]->GetCluster(cli);
- AliITSRecPoint* cl = (AliITSRecPoint*)GetCluster(index);
+ AliITSRecPointU* cl = (AliITSRecPointU*)GetCluster(index);
if(cl->TestBit(kSAflag)==kTRUE) cl->ResetBit(kSAflag);
inx[lay]=index;
check2 = fSegmentation->DetToGlobal(layer,xz[0], xz[1],x,y,z);
- Double_t phiclrad, phicldeg;
+ Double_t phiclrad;
phiclrad=TMath::ATan2(y,x);
if (phiclrad<0) phiclrad+=TMath::TwoPi();
else if (phiclrad>=TMath::TwoPi()) phiclrad-=TMath::TwoPi();
- phicldeg=180.*phiclrad/TMath::Pi();
- Int_t ladder=(Int_t)(phicldeg/18.);//virtual segmentation
- Double_t alpha= (ladder*18.+9.)*TMath::Pi()/180.;
+ Double_t alpha = fSegmentation->GetAlpha(fSegmentation->GetModule(phiclrad));
+
AliITStrackU trac(alpha,radius,yclu1,zclu1,phi2,tgl2,cv,1,fNLayers);
if(cl7!=0){
trac.AddClusterV2(7,(clind[7][l7] & 0x0fffffff)>>0);
Int_t ncl = fCluLayer[layer]->GetEntries();
AliDebug(2,Form(" Number of clusters %i in layer %i.",ncl,layer));
for (Int_t index=0; index<ncl; index++) {
- AliITSRecPoint *c = (AliITSRecPoint*)fCluLayer[layer]->At(index);
+ AliITSRecPointU *c = (AliITSRecPointU*)fCluLayer[layer]->At(index);
if (!c) continue;
if (c->GetQ()<=0) continue;
if(layer>1 && c->GetQ()<=fMinQ) continue;
Bool_t AliITStrackerUpgrade::SetFirstPoint(Int_t lay, Int_t clu, Double_t* primaryVertex){
// Sets the first point (seed) for tracking
- AliITSRecPoint* cl = (AliITSRecPoint*)fCluLayer[lay]->At(clu);
+ AliITSRecPointU* cl = (AliITSRecPointU*)fCluLayer[lay]->At(clu);
if(!cl) return kFALSE;
if (cl->GetQ()<=0) return kFALSE;
if(lay>1 && cl->GetQ()<=fMinQ) return kFALSE;
Int_t iNotLabel=0;
for(Int_t i=0;i<track->GetNumberOfClusters(); i++) {
Int_t indexc = track->GetClusterIndex(i);
- AliITSRecPoint* cl = (AliITSRecPoint*)GetCluster(indexc);
+ AliITSRecPointU* cl = (AliITSRecPointU*)GetCluster(indexc);
AliDebug(2,Form(" cluster index %i ",indexc));
Int_t iLayer=cl->GetLayer();
for(Int_t k=0;k<3;k++){
}
//_______________________________________________________________________
-void AliITStrackerUpgrade::GetCoorAngles(AliITSRecPoint* cl,Double_t &phi,Double_t &lambda, Double_t &x, Double_t &y,Double_t &z,Double_t* vertex){
+void AliITStrackerUpgrade::GetCoorAngles(AliITSRecPointU* cl,Double_t &phi,Double_t &lambda, Double_t &x, Double_t &y,Double_t &z,Double_t* vertex){
//Returns values of phi (azimuthal) and lambda angles for a given cluster
- /*
- Double_t rot[9]; fGeom->GetRotMatrix(module,rot);
- Int_t lay,lad,det; fGeom->GetModuleId(module,lay,lad,det);
- Float_t tx,ty,tz; fGeom->GetTrans(lay,lad,det,tx,ty,tz);
-
- Double_t alpha=TMath::ATan2(rot[1],rot[0])+TMath::Pi();
- Double_t phi1=TMath::Pi()/2+alpha;
- if (lay==1) phi1+=TMath::Pi();
-
- Float_t cp=TMath::Cos(phi1), sp=TMath::Sin(phi1);
- Float_t r=tx*cp+ty*sp;
-
- xyz= r*cp - cl->GetY()*sp;
- y= r*sp + cl->GetY()*cp;
- z=cl->GetZ();
- */
Double_t xz[2];
xz[0]= cl->GetDetLocalX();
}
//________________________________________________________________________
-void AliITStrackerUpgrade::GetCoorErrors(AliITSRecPoint* cl,Float_t &sx,Float_t &sy, Float_t &sz){
+void AliITStrackerUpgrade::GetCoorErrors(AliITSRecPointU* cl,Float_t &sx,Float_t &sy, Float_t &sz){
//returns sigmax, y, z of cluster in global coordinates
/*
if (phi<0) phi+=TMath::TwoPi();//from 0 to 360 (rad)
else if (phi>=TMath::TwoPi()) phi-=TMath::TwoPi();//
- Double_t phideg=0.;
- phideg=180.*phi/TMath::Pi();// in deg
- Int_t ladder=(Int_t)(phideg/18.);// virtual segmentation
- Double_t alpha= (ladder*18.+9.)*TMath::Pi()/180.;
+
+ Double_t alpha = fSegmentation->GetAlpha(fSegmentation->GetModule(phi));
if (!track->Propagate(alpha,r)) {
return kFALSE;
}
- const AliITSRecPoint *clAcc=0;
+ const AliITSRecPointU *clAcc=0;
Double_t maxchi2=1000.*AliITSReconstructor::GetRecoParam()->GetMaxChi2();
Int_t idx=index[ilayer];
if (idx>=0) { // cluster in this layer
Int_t cli = idx&0x0fffffff;
- const AliITSRecPoint *cl=(AliITSRecPoint *)fLayers[ilayer]->GetCluster(cli);
+ const AliITSRecPointU *cl=(AliITSRecPointU *)fLayers[ilayer]->GetCluster(cli);
if (cl) {
Int_t cllayer = (idx & 0xf0000000) >> 28;;
}
//_____________________________________________________________________
-Int_t AliITStrackerUpgrade::UpdateMI(AliITStrackU* track, const AliITSRecPoint* cl,Double_t chi2,Int_t index) const
+Int_t AliITStrackerUpgrade::UpdateMI(AliITStrackU* track, const AliITSRecPointU* cl,Double_t chi2,Int_t index) const
{
//
// Update ITS track
//_____________________________________________________________________________
-Double_t AliITStrackerUpgrade::GetPredictedChi2MI(AliITStrackU* track, const AliITSRecPoint *cluster,Int_t layer)
+Double_t AliITStrackerUpgrade::GetPredictedChi2MI(AliITStrackU* track, const AliITSRecPointU *cluster,Int_t layer)
{
//
// Compute predicted chi2
}
//________________________________________________________________
Int_t AliITStrackerUpgrade::GetError(Int_t /*layer*/,
- const AliITSRecPoint *cl,
+ const AliITSRecPointU *cl,
Float_t /*tgl*/,Float_t /*tgphitr*/,Float_t /*expQ*/,
Float_t &erry,Float_t &errz,Float_t &covyz,
Bool_t /*addMisalErr*/)
}
//____________________________________________________________________-
-Int_t AliITStrackerUpgrade::GetErrorOrigRecPoint(const AliITSRecPoint*cl,
+Int_t AliITStrackerUpgrade::GetErrorOrigRecPoint(const AliITSRecPointU *cl,
Float_t &erry,Float_t &errz,Float_t &covyz)
{
//
return 1;
}
//__________________________
-void AliITStrackerUpgrade::GetNTeor(Int_t layer,const AliITSRecPoint* /*cl*/,
+void AliITStrackerUpgrade::GetNTeor(Int_t layer,const AliITSRecPointU* /*cl*/,
Float_t tgl,Float_t tgphitr,
Float_t &ny,Float_t &nz)
{
#ifndef ALIITSTRACKERUPGRADE_H
#define ALIITSTRACKERUPGRADE_H
-
-
-#include "AliITStrackerMI.h"
-#include "AliITSlayerUpgrade.h"
-#include "AliITStrackU.h"
-
/* Copyright(c) 1998-2003, ALICE Experiment at CERN, All rights reserved. *
* See cxx source for full Copyright notice */
// tracks are saved as AliITStrackV2 objects //
////////////////////////////////////////////////////
+
+
#include <TClonesArray.h>
+#include "AliITSRecPointU.h"
+#include "AliITStrackerMI.h"
+#include "AliITSlayerUpgrade.h"
+#include "AliITStrackU.h"
class AliITSclusterTable;
class AliITStrackU;
Int_t SearchClusters(Int_t layer,Double_t phiwindow,Double_t lambdawindow,
AliITStrackU* trs,Double_t zvertex,Int_t flagp);
- void GetCoorAngles(AliITSRecPoint* cl,Double_t &phi,Double_t &lambda,Double_t &x,Double_t &y,Double_t &z,Double_t* vertex);
- void GetCoorErrors(AliITSRecPoint* cl,Float_t &sx,Float_t &sy, Float_t &sz);
+ void GetCoorAngles(AliITSRecPointU* cl,Double_t &phi,Double_t &lambda,Double_t &x,Double_t &y,Double_t &z,Double_t* vertex);
+ void GetCoorErrors(AliITSRecPointU* cl,Float_t &sx,Float_t &sy, Float_t &sz);
AliITSclusterTable* GetClusterCoord(Int_t layer,Int_t n) const {return (AliITSclusterTable*)fCluCoord[layer]->UncheckedAt(n);}
void RemoveClusterCoord(Int_t layer, Int_t n) {fCluCoord[layer]->RemoveAt(n);fCluCoord[layer]->Compress();}
Bool_t RefitAtBase(Double_t x, AliITStrackU *track,
const Int_t *clusters);
- Int_t UpdateMI(AliITStrackU* track, const AliITSRecPoint* cl,Double_t chi2,Int_t layer) const;
+ Int_t UpdateMI(AliITStrackU* track, const AliITSRecPointU* cl,Double_t chi2,Int_t layer) const;
Int_t CorrectForLayerMaterial(AliITStrackU *t, Int_t layerindex, Double_t oldGlobXYZ[3], TString direction="inward");
- Double_t GetPredictedChi2MI(AliITStrackU* track, const AliITSRecPoint *cluster,Int_t layer);
- static Int_t GetError(Int_t layer,const AliITSRecPoint*cl,
+ Double_t GetPredictedChi2MI(AliITStrackU* track, const AliITSRecPointU *cluster,Int_t layer);
+ static Int_t GetError(Int_t layer,const AliITSRecPointU *cl,
Float_t tgl,Float_t tgphitr,Float_t expQ,
Float_t &erry,Float_t &errz,Float_t &covyz,
Bool_t addMisalErr=kTRUE);
- static Int_t GetErrorOrigRecPoint(const AliITSRecPoint*cl,
+ static Int_t GetErrorOrigRecPoint(const AliITSRecPointU*cl,
Float_t &erry,Float_t &errz,Float_t &covyz);
- static void GetNTeor(Int_t layer,const AliITSRecPoint* cl,
+ static void GetNTeor(Int_t layer,const AliITSRecPointU* cl,
Float_t tgl,Float_t tgphitr,
Float_t &ny,Float_t &nz);
static const Int_t fgMaxNLayer = 8; //max number of layers in ITSUpgrade
#include <TArrayD.h> //new constructor
#include <TFile.h>
-#include <TGeoManager.h> //CreateGeometry()
+#include <TGeoManager.h>
#include <TGeoVolume.h> //CreateGeometry()
+#include <TGeoMatrix.h>
#include <TVirtualMC.h> //->gMC in StepManager
#include <TPDGCode.h> //StepHistory
#include <TClonesArray.h>
AliITS(),
fWidths(0),
fRadii(0),
+ fNSectors(20),
fRadiiCu(0),
fWidthsCu(0),
fCopper(0),
fHalfLength(0),
fSdigits(0),
fDigits(0),
- //fClusters(0),
fSegmentation(0x0)
{
//
AliITS(name,title),
fWidths(0),
fRadii(0),
+ fNSectors(20),
fRadiiCu(0),
fWidthsCu(0),
fCopper(0),
}
SetFullSegmentation(xsizeSi,zsizeSi);
- Init();
}
//__________________________________________________________________________________________________
AliITSupgrade::AliITSupgrade(const char *name,const char *title, TArrayD widths, TArrayD radii,TArrayD halfLengths, TArrayD radiiCu, TArrayD widthsCu, TArrayS copper,Bool_t bp,Double_t radiusBP, Double_t widthBP, Double_t halfLengthBP):
AliITS(name,title),
fWidths(0),
fRadii(0),
+ fNSectors(20),
fRadiiCu(radiiCu),
fWidthsCu(widthsCu),
fCopper(copper),
fHalfLength(halfLengths),
fSdigits(0),
fDigits(0),
- //fClusters(0),
fSegmentation(0x0)
{
PrintSummary();
}
//__________________________________________________________________________________________________
-void AliITSupgrade::Init()
-{
- // This method defines ID for sensitive volumes, i.e. such geometry volumes for which there are if(gMC->CurrentVolID()==XXX)
- // statements in StepManager()
- // Arguments: none
- // Returns: none
- AliDebug(1,"Init ITS upgrade preliminary version.");
-}
-//__________________________________________________________________________________________________
void AliITSupgrade::StepManager()
{
// Full Step Manager.
// Returns: none
// StepHistory(); return; //uncomment to print tracks history
// StepCount(); return; //uncomment to count photons
+
+ if(!fSegmentation) AliFatal("No segmentation available");
+
if(!(this->IsActive())) return;
if(!(gMC->TrackCharge())) return;
TString volumeName=gMC->CurrentVolName();
- if(gMC->IsTrackExiting() && !volumeName.Contains("Cu") && !volumeName.Contains("Be")) {
+ if(volumeName.Contains("Be")) return;
+ if(volumeName.Contains("Cu")) return;
+ if(gMC->IsTrackExiting()) {
AddTrackReference(gAlice->GetMCApp()->GetCurrentTrackNumber(), AliTrackReference::kITS);
} // if Outer ITS mother Volume
//
// Fill hit structure.
//
- TString volname = gMC->CurrentVolName();
- if(volname.Contains("Cu"))return;
- if(volname.Contains("Be"))return;
- volname.Remove(0,12); // remove letters to get the layer number
- hit.SetModule(volname.Atoi()); // this will be the layer, not the module
+ Int_t copy=-1;
+ gMC->CurrentVolID(copy);
+
+ volumeName.Remove(0,12); // remove letters to get the layer number
+ hit.SetModule(fSegmentation->GetIdIndex(volumeName.Atoi(),copy)); // layer and sector information are together in the IdIndex (if copy=0 the idIndex is the layer));
hit.SetTrack(gAlice->GetMCApp()->GetCurrentTrackNumber());
gMC->TrackPosition(position);
//__________________________________________________________________________________________________
TGeoVolumeAssembly * AliITSupgrade::CreateVol()
{
- TGeoVolumeAssembly *vol = new TGeoVolumeAssembly("ITSupgrade");
+
+ TGeoVolumeAssembly *vol = new TGeoVolumeAssembly("ITSupgrade");
TGeoMedium *si =gGeoManager->GetMedium("ITS_UpgradeSi");
TGeoMedium *cu =gGeoManager->GetMedium("ITS_UpgradeCu");
TGeoMedium *be =gGeoManager->GetMedium("ITS_UpgradeBe");
for(Int_t ivol=0;ivol<fNlayers;ivol++){
- TGeoVolume *layer=gGeoManager->MakeTube(Form("LayerSilicon%i",ivol),si , fRadii.At(ivol) , fRadii.At(ivol)+fWidths.At(ivol) , fHalfLength.At(ivol)); //upgraded situation
-
- TGeoVolume *layerCu=gGeoManager->MakeTube(Form("LayerCu%i",ivol),cu , fRadiiCu.At(ivol) , fRadiiCu.At(ivol)+fWidthsCu.At(ivol) , fHalfLength.At(ivol) ); //upgraded situation
-
- vol ->AddNode(layer,ivol);
- if(fCopper.At(ivol)){
- vol->AddNode(layerCu,ivol);
+ if(fNSectors<1){
+ TGeoVolume *layer=gGeoManager->MakeTube(Form("LayerSilicon%i",ivol),si , fRadii.At(ivol) , fRadii.At(ivol)+fWidths.At(ivol) , fHalfLength.At(ivol)); //upgraded situation
+
+ TGeoVolume *layerCu=gGeoManager->MakeTube(Form("LayerCu%i",ivol),cu , fRadiiCu.At(ivol) , fRadiiCu.At(ivol)+fWidthsCu.At(ivol) , fHalfLength.At(ivol) ); //upgraded situation
+
+ vol ->AddNode(layer,ivol);
+ if(fCopper.At(ivol)){
+ vol->AddNode(layerCu,ivol);
+ }
+
+ }else{
+
+ TGeoVolume *layer = gGeoManager->MakeTubs(Form("LayerSilicon%i",ivol),si, fRadii.At(ivol), fRadii.At(ivol)+fWidths.At(ivol) ,fHalfLength.At(ivol),0,(360./fNSectors));
+ TGeoVolume *layerCu = gGeoManager->MakeTubs(Form("LayerCu%i",ivol),cu , fRadiiCu.At(ivol) , fRadiiCu.At(ivol)+fWidthsCu.At(ivol) , fHalfLength.At(ivol) ,0,(360./fNSectors));
+
+
+ for(Int_t i=0;i<fNSectors;i++){
+ TGeoRotation *rot1 = new TGeoRotation(" ",0.0,0.0,360.*i/fNSectors);//sector rotation
+ TGeoRotation *rot2 = new TGeoRotation(" ",0.0,0.0,360.*i/fNSectors);//
+ vol->AddNode(layer,i,rot1);
+ if(fCopper.At(ivol)){
+ vol->AddNode(layerCu,i,rot2);
+ }
+ }
}
}
- TGeoVolume *beampipe=gGeoManager->MakeTube("BeamPipe", be , fRadiusBP , fRadiusBP+ fWidthBP , fHalfLengthBP ); //upgraded situation
+
+
+ if(fBeampipe) {
+ TGeoVolume *beampipe=gGeoManager->MakeTube("BeamPipe", be , fRadiusBP , fRadiusBP+ fWidthBP , fHalfLengthBP ); //upgraded situation
+ vol->AddNode(beampipe,0);
+ }
+ return vol;
- if(fBeampipe) vol->AddNode(beampipe,0);
- return vol;
}
//_________________________________________________________________________________________________
void AliITSupgrade::SetFullSegmentation(TArrayD xsize,TArrayD zsize){
+
+ Bool_t Check=kFALSE;
+ for(Int_t lay = 0; lay< xsize.GetSize(); lay++){
+ Double_t arch = fRadii.At(lay)*(TMath::Pi()*2/fNSectors);
+ Int_t nPixRPhi = (Int_t)(arch/xsize.At(lay));
+ Int_t nPixZed = (Int_t)((2*fHalfLength.At(lay))/zsize.At(lay));
+ if(nPixRPhi>9999)Check=kTRUE;
+ if(nPixZed>99999)Check=kTRUE;
+ }
+ if(Check) AliFatal(" Segmentation is too small!! ");
+ if(fSegmentation) fSegmentation->SetNSectors(fNSectors);
+ TArrayD nSect(1);
+ nSect.AddAt(fNSectors,0);
TFile *file= TFile::Open("Segmentation.root","recreate");
file->WriteObjectAny(&xsize,"TArrayD","CellSizeX");
- file->WriteObjectAny(&zsize,"TArrayD","CellSizeZ");
+ file->WriteObjectAny(&zsize,"TArrayD","CellSizeZ");
+ file->WriteObjectAny(&nSect,"TArrayD","nSectors");
file->Close();
}
//_________________________________________________________________________________________________
for(Int_t iHit=0;iHit<hits->GetEntries();iHit++){ //hits loop
AliITShit *hit = (AliITShit*)hits->At(iHit);
Double_t xz[2];
- if(!fSegmentation->GlobalToDet(hit->GetModule(),hit->GetXG(),hit->GetYG(),hit->GetZG(),xz[0],xz[1])) continue;
+
+ Int_t module;
+ if(!fSegmentation->GlobalToDet(fSegmentation->GetLayerFromIdIndex(hit->GetModule()),hit->GetXG(),hit->GetYG(),hit->GetZG(),xz[0],xz[1],module)) continue;
AliITSDigitUpgrade digit;
digit.SetSignal(hit->GetIonization());
digit.SetNelectrons(hit->GetIonization()/(3.62*1e-09));
- digit.SetLayer(hit->GetModule());
+ digit.SetLayer(fSegmentation->GetLayerFromIdIndex(hit->GetModule()));
+ digit.SetModule(fSegmentation->GetModuleFromIdIndex(hit->GetModule()));//set the module (=sector) of ITSupgrade
digit.SetTrackID(hit->GetTrack());
Int_t xpix = 999;
- if(fSegmentation->GetCellSizeX(hit->GetModule())!=0) xpix =(Int_t) (xz[0]/ fSegmentation->GetCellSizeX(hit->GetModule()));
-
Int_t zpix = 999; // shift at the next line to have zpix always positive. Such numbers are used to build the Pixel Id in the layer (> 0!)
- if(fSegmentation->GetCellSizeZ(hit->GetModule())!=0){
- zpix =(Int_t)((xz[1]+fHalfLength.At(hit->GetModule())) / fSegmentation->GetCellSizeZ(hit->GetModule()));
- }
+ fSegmentation->DetToPixID(xz[0], xz[1],fSegmentation->GetLayerFromIdIndex(hit->GetModule()), xpix, zpix);
digit.SetPixId(xpix,zpix);
-
+ new((*pSdigList[fSegmentation->GetLayerFromIdIndex(hit->GetModule())])[nSdigit[fSegmentation->GetLayerFromIdIndex(hit->GetModule())]++]) AliITSDigitUpgrade(digit);
- new((*pSdigList[hit->GetModule()])[nSdigit[hit->GetModule()]++]) AliITSDigitUpgrade(digit);
}
AliDebug(1,"Stop Hit2SumDig.");
#include "AliITSsegmentationUpgrade.h"
#include "AliITSupgradeDigitizer.h"
#include <TArrayS.h>
-
+
class TGeoVolume;
class TGeoVolumeAssembly;
class TArrayD;
void AddAlignableVolumes() const; //from AliModule invoked from AliMC
void CreateMaterials (); //from AliModule invoked from AliMC
void CreateGeometry (); //from AliModule invoked from AliMC
- void Init (); //from AliModule invoked from AliMC::InitGeometry()
void StepManager (); //from AliModule invoked from AliMC::Stepping()
void Hits2SDigits();
void MakeBranch (Option_t *opt=""); //from AliModule invokde from AliRun::Tree2Tree() to make requested ITSupgrade branch
// Geometry/segmentation creation part
TGeoVolumeAssembly * CreateVol();
+ TGeoVolumeAssembly * CreateVol(Bool_t cil);
+
void SetFullSegmentation(TArrayD xsize, TArrayD zsize);
void SetRadius(Double_t r, Int_t lay) {fRadii.AddAt(r,lay);}
void SetWidthCu(Double_t wCu, Int_t lay) {fWidthsCu.AddAt(wCu,lay);}
void SetSegmentationX(Double_t x, Int_t lay);
void SetSegmentationZ(Double_t z, Int_t lay);
-
+ void SetNSectors(Int_t nsect) {fNSectors=nsect;}
void StepHistory();
void PrintSummary();
protected:
TArrayD fWidths;
TArrayD fRadii;
+ Int_t fNSectors;
TArrayD fRadiiCu;
TArrayD fWidthsCu;
TArrayS fCopper;
AliITSDigitUpgrade *tmpdig=0x0;
pSDigitList[ilay].Sort();
-
+ Int_t module=999;
Int_t iNdigPart=0;
AliDebug(1,"starting loop over sdigits to create digits");
for(Int_t isdigentr=0; isdigentr<pSDigitList[ilay].GetEntries(); isdigentr++){
tmpdig = (AliITSDigitUpgrade*)(pSDigitList[ilay].At(isdigentr) ) ;
- if(tmpdig->GetPixId()==pixid) {
+ if(tmpdig->GetPixId()==pixid && tmpdig->GetModule()==module) {
iNdigPart++;
if(iNdigPart<=3) {
tids[iNdigPart-1] = tmpdig->GetTrack(0);
continue;
}
AliITSDigitUpgrade digit(pixid,eloss);
-
+
digit.SetNelectrons(nele);
digit.SetLayer(ilay);
+ digit.SetModule(module);
digit.SetTids(tids);
digit.SetSignalID(elossID);
if(isdigentr!=0) new((*pLst[ilay])[iCnt[ilay]++]) AliITSDigitUpgrade(digit);
tids[0]=tmpdig->GetTrack(0);
tids[1]=tids[2]=-1;
elossID[0]=tmpdig->GetSignal();
- elossID[1]=elossID[2]=-1;
+ elossID[1]=elossID[2]=-1;
+ module=tmpdig->GetModule();
}
if(!tmpdig) AliDebug(1,"\n \n---------> tmpdig is null...break is expected ! \n");
tmpdig->SetSignalID(elossID);
tmpdig->SetNelectrons(nele);
tmpdig->SetLayer(ilay);
+ tmpdig->SetModule(module);
//cout<<" tmpdigit : pixid "<< pixid<< " tids "<< tids << " nele " << nele << " ilay "<<ilay<<endl;
new((*pLst[ilay])[iCnt[ilay]++]) AliITSDigitUpgrade(*tmpdig);
}