// //
///////////////////////////////////////////////////////////////////////////////
-#include <stdlib.h>
+//#include <stdlib.h>
#include <TLorentzVector.h>
-#include <TMath.h>
#include <TPDGCode.h>
-#include <TVirtualMC.h>
#include <TString.h>
-#include <TSystem.h>
-
-#include "AliConst.h"
#include "AliLog.h"
-#include "AliMC.h"
-#include "AliRun.h"
-#include "AliTPCDigitsArray.h"
#include "AliTPCParam.h"
-#include "AliTPCParamSR.h"
#include "AliTPCTrackHitsV2.h"
#include "AliTPCv2.h"
-#include "TGeoManager.h"
#include "TGeoVolume.h"
#include "TGeoPcon.h"
#include "TGeoTube.h"
#include "TGeoTrd1.h"
#include "TGeoCompositeShape.h"
#include "TGeoPara.h"
+#include "TGeoPhysicalNode.h"
+
ClassImp(AliTPCv2)
//_____________________________________________________________________________
AliTPCv2::AliTPCv2(const char *name, const char *title) :
- AliTPC(name, title)
+ AliTPC(name, title),
+ fIdSens(0),
+ fIDrift(0),
+ fSecOld(0)
{
//
// Standard constructor for Time Projection Chamber version 2
//
// define reflection matrix
//
- TGeoRotation *ref = new TGeoRotation("ref",90.,0.,90.,270.,180.,0.);
+ TGeoRotation *ref = new TGeoRotation("ref",90.,0.,90.,90.,180.,0.);
//
cd1v->AddNode(cd2v,1); cd2v->AddNode(cd3v,1); cflv->AddNode(cd1v,1);
//
- v1->AddNode(siv,1,new TGeoTranslation(0.,0.,-72.1));
- v1->AddNode(siv,2,new TGeoTranslation(0.,0.,72.1));
+ v1->AddNode(siv,1,new TGeoTranslation(0.,0.,-69.9));
+ v1->AddNode(siv,2,new TGeoTranslation(0.,0.,69.9));
v1->AddNode(sev,1); v1->AddNode(sev,2,ref); v1->AddNode(cflv,1);
//
// central membrane - 2 rings and a mylar membrane - assembly
// end caps - they are make as an assembly of single segments
// containing both readout chambers
//
- Double_t OpeningAngle = 10.*TMath::DegToRad();
+ Double_t openingAngle = 10.*TMath::DegToRad();
Double_t thick=1.5; // rib
- Double_t shift = thick/TMath::Sin(OpeningAngle);
+ Double_t shift = thick/TMath::Sin(openingAngle);
//
- Double_t LowEdge = 86.3; // hole in the wheel
- Double_t UpEdge = 240.4; // hole in the wheel
+ Double_t lowEdge = 86.3; // hole in the wheel
+ Double_t upEdge = 240.4; // hole in the wheel
//
new TGeoTubeSeg("sec",74.5,264.4,3.,0.,20.);
//
TGeoPgon *hole = new TGeoPgon("hole",0.,20.,1,4);
//
- hole->DefineSection(0,-3.5,LowEdge-shift,UpEdge-shift);
- hole->DefineSection(1,-1.5,LowEdge-shift,UpEdge-shift);
+ hole->DefineSection(0,-3.5,lowEdge-shift,upEdge-shift);
+ hole->DefineSection(1,-1.5,lowEdge-shift,upEdge-shift);
//
- hole->DefineSection(2,-1.5,LowEdge-shift,UpEdge+3.-shift);
- hole->DefineSection(3,3.5,LowEdge-shift,UpEdge+3.-shift);
+ hole->DefineSection(2,-1.5,lowEdge-shift,upEdge+3.-shift);
+ hole->DefineSection(3,3.5,lowEdge-shift,upEdge+3.-shift);
//
- Double_t ys = shift*TMath::Sin(OpeningAngle);
- Double_t xs = shift*TMath::Cos(OpeningAngle);
+ Double_t ys = shift*TMath::Sin(openingAngle);
+ Double_t xs = shift*TMath::Cos(openingAngle);
TGeoTranslation *tr = new TGeoTranslation("tr",xs,ys,0.);
tr->RegisterYourself();
TGeoCompositeShape *chamber = new TGeoCompositeShape("sec-hole:tr");
//
// now iroc and oroc are placed into a sector...
//
- TGeoVolumeAssembly *sect = new TGeoVolumeAssembly("TPC_SECT");
+ TGeoVolumeAssembly *secta = new TGeoVolumeAssembly("TPC_SECT"); // a-side
+ TGeoVolumeAssembly *sectc = new TGeoVolumeAssembly("TPC_SECT"); // c-side
TGeoRotation rot1("rot1",90.,90.,0.);
TGeoRotation rot2("rot2");
rot2.RotateY(10.);
*rot=rot1*rot2;
//
Double_t x0,y0;
- x0=110.2*TMath::Cos(OpeningAngle);
- y0=110.2*TMath::Sin(OpeningAngle);
- TGeoCombiTrans *combi1 = new TGeoCombiTrans("combi1",x0,y0,1.09,rot);
- x0=188.45*TMath::Cos(OpeningAngle);
- y0=188.45*TMath::Sin(OpeningAngle);
- TGeoCombiTrans *combi2 = new TGeoCombiTrans("combi2",x0,y0,0.99,rot);
+ x0=110.2*TMath::Cos(openingAngle);
+ y0=110.2*TMath::Sin(openingAngle);
+ TGeoCombiTrans *combi1a = new TGeoCombiTrans("combi1",x0,y0,1.09+0.222,rot); //a-side
+ TGeoCombiTrans *combi1c = new TGeoCombiTrans("combi1",x0,y0,1.09+0.195,rot); //c-side
+ x0=188.45*TMath::Cos(openingAngle);
+ y0=188.45*TMath::Sin(openingAngle);
+ TGeoCombiTrans *combi2a = new TGeoCombiTrans("combi2",x0,y0,0.99+0.222,rot); //a-side
+ TGeoCombiTrans *combi2c = new TGeoCombiTrans("combi2",x0,y0,0.99+0.195,rot); //c-side
+ //
+ //
+ // A-side
+ //
+ secta->AddNode(ch,1);
+ secta->AddNode(iroc,1,combi1a);
+ secta->AddNode(oroc,1,combi2a);
//
- sect->AddNode(ch,1);
- sect->AddNode(iroc,1,combi1);
- sect->AddNode(oroc,1,combi2);
+ // C-side
//
- // segment is ready...
- // now I try to make a wheel...
+ sectc->AddNode(ch,1);
+ sectc->AddNode(iroc,1,combi1c);
+ sectc->AddNode(oroc,1,combi2c);
//
- TGeoVolumeAssembly *wheel = new TGeoVolumeAssembly("TPC_ENDCAP");
+ // now I try to make wheels...
+ //
+ TGeoVolumeAssembly *wheela = new TGeoVolumeAssembly("TPC_ENDCAP");
+ TGeoVolumeAssembly *wheelc = new TGeoVolumeAssembly("TPC_ENDCAP");
//
for(Int_t i =0;i<18;i++){
Double_t phi = (20.*i);
TGeoRotation *r = new TGeoRotation();
r->RotateZ(phi);
- wheel->AddNode(sect,i+1,r);
+ wheela->AddNode(secta,i+1,r);
+ wheelc->AddNode(sectc,i+1,r);
}
- // wheels in the drift volume!
- v9->AddNode(wheel,1,new TGeoTranslation(0.,0.,-256.6));
+ // wheels in the drift volume!
+
TGeoCombiTrans *combi3 = new TGeoCombiTrans("combi3",0.,0.,256.6,ref);
- v9->AddNode(wheel,2,combi3);
-
+ v9->AddNode(wheela,1,combi3);
+ v9->AddNode(wheelc,2,new TGeoTranslation(0.,0.,-256.6));
//_____________________________________________________________
// service support wheel
//_____________________________________________________________
TGeoVolume *swv = new TGeoVolume("TPC_SWSEG",sw,m3); //Al
//
thick=1.;
- shift = thick/TMath::Sin(OpeningAngle);
+ shift = thick/TMath::Sin(openingAngle);
TGeoPgon *sh = new TGeoPgon(0.,20.,1,2);
sh->DefineSection(0,-4.,81.5-shift,250.75-shift);
sh->DefineSection(1,4.,81.5-shift,250.75-shift);
shv->AddNode(elv,1);
//
//
- ys = shift*TMath::Sin(OpeningAngle);
- xs = shift*TMath::Cos(OpeningAngle);
+ ys = shift*TMath::Sin(openingAngle);
+ xs = shift*TMath::Cos(openingAngle);
swv->AddNode(shv,1,new TGeoTranslation(xs,ys,0.));
// cover
TGeoPgon *co = new TGeoPgon(0.,20.,1,2);
TGeoVolume *cov = new TGeoVolume("TPC_SWC1",co,m3);//Al
// hole in a cover
TGeoPgon *coh = new TGeoPgon(0.,20.,1,2);
- shift=4./TMath::Sin(OpeningAngle);
+ shift=4./TMath::Sin(openingAngle);
coh->DefineSection(0,-0.5,85.-shift,247.25-shift);
coh->DefineSection(1,0.5,85.-shift,247.25-shift);
//
TGeoVolume *cohv = new TGeoVolume("TPC_SWC2",coh,m1);
//
- ys = shift*TMath::Sin(OpeningAngle);
- xs = shift*TMath::Cos(OpeningAngle);
+ ys = shift*TMath::Sin(openingAngle);
+ xs = shift*TMath::Cos(openingAngle);
cov->AddNode(cohv,1,new TGeoTranslation(xs,ys,0.));
//
// Sector as an Assembly
//
//HV rods - makrolon + 0.58cm (diameter) Cu
- TGeoTube *hvr = new TGeoTube(0.,4.4,126.64);
+ TGeoTube *hvr = new TGeoTube(0.,2.2,126.64);
TGeoTube *hvc = new TGeoTube(0.,0.29,126.64);
//
TGeoVolume *hvrv = new TGeoVolume("TPC_HV_Rod",hvr,m6);
TGeoVolume *hvcv = new TGeoVolume("TPC_HV_Cable",hvc,m7);
hvrv->AddNode(hvcv,1);
- for(Int_t i=0;i<17;i++){
+ for(Int_t i=0;i<18;i++){
Double_t angle,x,y;
Double_t z,r;
angle=TMath::DegToRad()*20.*(Double_t)i;
}
else{
gGeoManager->Node("TPC_Rod",i+1,"TPC_Drift",x,y,z,0,kTRUE,upar,3);//shaft
- gGeoManager->Node("TPC_Rod",i+18,"TPC_Drift",x,y,-z,0,kTRUE,upar,3);//muon
+ gGeoManager->Node("TPC_Rod",i+19,"TPC_Drift",x,y,-z,0,kTRUE,upar,3);//muon
}
r=254.25;
x=r * TMath::Cos(angle);
y=r * TMath::Sin(angle);
upar[2]=126.54; //upper
z=127.06;
- gGeoManager->Node("TPC_Rod",i+36,"TPC_Drift",x,y,z,0,kTRUE,upar,3);
- gGeoManager->Node("TPC_Rod",i+54,"TPC_Drift",x,y,-z,0,kTRUE,upar,3);
+ gGeoManager->Node("TPC_Rod",i+37,"TPC_Drift",x,y,z,0,kTRUE,upar,3);
+ gGeoManager->Node("TPC_Rod",i+55,"TPC_Drift",x,y,-z,0,kTRUE,upar,3);
}
TGeoVolume *alice = gGeoManager->GetVolume("ALIC");
alice->AddNode(v1,1);
-
} // end of function
//_____________________________________________________________________________
-void AliTPCv2::DrawDetector()
+void AliTPCv2::AddAlignableVolumes() const
+{
+ //
+ // Create entries for alignable volumes associating the symbolic volume
+ // name with the corresponding volume path. Needs to be syncronized with
+ // eventual changes in the geometry.
+ //
+ SetInnerChambersAlignable();
+ SetOuterChambersAlignable();
+}
+
+//_____________________________________________________________________________
+void AliTPCv2::SetInnerChambersAlignable() const
+{
+ //
+ Int_t modnum = 0;
+ TString vpstr1 = "ALIC_1/TPC_M_1/TPC_Drift_1/TPC_ENDCAP_1/TPC_SECT_";
+ TString vpstr2 = "ALIC_1/TPC_M_1/TPC_Drift_1/TPC_ENDCAP_2/TPC_SECT_";
+ TString vpappend = "/TPC_IROC_1";
+ TString snstr1="TPC/EndcapA/Sector";
+ TString snstr2="TPC/EndcapC/Sector";
+ TString snappend="/InnerChamber";
+ TString volpath, symname;
+
+ for(Int_t cnt=1; cnt<=18; cnt++){
+ volpath = vpstr1;
+ volpath += cnt;
+ volpath += vpappend;
+ symname = snstr1;
+ symname += cnt;
+ symname += snappend;
+ if(!gGeoManager->SetAlignableEntry(symname.Data(),volpath.Data()))
+ AliFatal(Form("Alignable entry %s not created. Volume path %s not valid", symname.Data(),volpath.Data()));
+ //
+ TGeoPNEntry *alignableEntry = gGeoManager->GetAlignableEntry(symname.Data());
+ const char *path = alignableEntry->GetTitle();
+ if (!gGeoManager->cd(path))
+ AliFatal(Form("Volume path %s not valid!",path));
+ TGeoHMatrix* globMatrix = gGeoManager->GetCurrentMatrix();
+ TGeoHMatrix* matTtoL = fTPCParam->Tracking2LocalMatrix(globMatrix,cnt-1);
+ alignableEntry->SetMatrix(matTtoL);
+ modnum++;
+ }
+
+ for(Int_t cnt=1; cnt<=18; cnt++){
+ volpath = vpstr2;
+ volpath += cnt;
+ volpath += vpappend;
+ symname = snstr2;
+ symname += cnt;
+ symname += snappend;
+ if(!gGeoManager->SetAlignableEntry(symname.Data(),volpath.Data()))
+ AliFatal(Form("Alignable entry %s not created. Volume path %s not valid", symname.Data(),volpath.Data()));
+ TGeoPNEntry *alignableEntry = gGeoManager->GetAlignableEntry(symname.Data());
+ const char *path = alignableEntry->GetTitle();
+ if (!gGeoManager->cd(path))
+ AliFatal(Form("Volume path %s not valid!",path));
+ TGeoHMatrix* globMatrix = gGeoManager->GetCurrentMatrix();
+ TGeoHMatrix* matTtoL = fTPCParam->Tracking2LocalMatrix(globMatrix,18+cnt-1);
+ alignableEntry->SetMatrix(matTtoL);
+ modnum++;
+ }
+}
+
+//_____________________________________________________________________________
+void AliTPCv2::SetOuterChambersAlignable() const
+{
+ //
+ Int_t modnum = 0;
+ TString vpstr1 = "ALIC_1/TPC_M_1/TPC_Drift_1/TPC_ENDCAP_1/TPC_SECT_";
+ TString vpstr2 = "ALIC_1/TPC_M_1/TPC_Drift_1/TPC_ENDCAP_2/TPC_SECT_";
+ TString vpappend = "/TPC_OROC_1";
+ TString snstr1="TPC/EndcapA/Sector";
+ TString snstr2="TPC/EndcapC/Sector";
+ TString snappend="/OuterChamber";
+ TString volpath, symname;
+
+ for(Int_t cnt=1; cnt<=18; cnt++){
+ volpath = vpstr1;
+ volpath += cnt;
+ volpath += vpappend;
+ symname = snstr1;
+ symname += cnt;
+ symname += snappend;
+ if(!gGeoManager->SetAlignableEntry(symname.Data(),volpath.Data()))
+ AliFatal(Form("Alignable entry %s not created. Volume path %s not valid", symname.Data(),volpath.Data()));
+ TGeoPNEntry *alignableEntry = gGeoManager->GetAlignableEntry(symname.Data());
+ const char *path = alignableEntry->GetTitle();
+ if (!gGeoManager->cd(path))
+ AliFatal(Form("Volume path %s not valid!",path));
+ TGeoHMatrix* globMatrix = gGeoManager->GetCurrentMatrix();
+ TGeoHMatrix* matTtoL = fTPCParam->Tracking2LocalMatrix(globMatrix,36+cnt-1);
+ alignableEntry->SetMatrix(matTtoL);
+ modnum++;
+ }
+
+ for(Int_t cnt=1; cnt<=18; cnt++){
+ volpath = vpstr2;
+ volpath += cnt;
+ volpath += vpappend;
+ symname = snstr2;
+ symname += cnt;
+ symname += snappend;
+ if(!gGeoManager->SetAlignableEntry(symname.Data(),volpath.Data()))
+ AliFatal(Form("Alignable entry %s not created. Volume path %s not valid", symname.Data(),volpath.Data()));
+ TGeoPNEntry *alignableEntry = gGeoManager->GetAlignableEntry(symname.Data());
+ const char *path = alignableEntry->GetTitle();
+ if (!gGeoManager->cd(path))
+ AliFatal(Form("Volume path %s not valid!",path));
+ TGeoHMatrix* globMatrix = gGeoManager->GetCurrentMatrix();
+ TGeoHMatrix* matTtoL = fTPCParam->Tracking2LocalMatrix(globMatrix,36+18+cnt-1);
+ alignableEntry->SetMatrix(matTtoL);
+ modnum++;
+ }
+}
+
+//_____________________________________________________________________________
+void AliTPCv2::DrawDetector() const
{
//
// Draw a shaded view of the Time Projection Chamber version 1