///////////////////////////////////////////////////////////////////////////////
-// //
-// Inner Traking System //
-// This class contains the base procedures for the Inner Tracking System //
-// //
+//
+// An overview of the basic philosophy of the ITS code development
+// and analysis is show in the figure below.
//Begin_Html
/*
-<img src="picts/AliITSClass.gif">
+<img src="figures/ITS_Analysis_schema.gif">
</pre>
<br clear=left>
<font size=+2 color=red>
-<p>The responsible person for this module is
+<p>Roberto Barbera is in charge of the ITS Offline code (1999).
<a href="mailto:roberto.barbera@ct.infn.it">Roberto Barbera</a>.
</font>
<pre>
*/
//End_Html
-// //
+//
+// AliITS. Inner Traking System base class.
+// This class contains the base procedures for the Inner Tracking System
+//
+//Begin_Html
+/*
+<img src="figures/AliITS_Class_Diagram.gif">
+</pre>
+<br clear=left>
+<font size=+2 color=red>
+<p>This show the class diagram of the different elements that are part of
+the AliITS class.
+</font>
+<pre>
+*/
+//End_Html
+//
+// Version: 0
+// Written by Rene Brun, Federico Carminati, and Roberto Barbera
+//
+// Version: 1
+// Modified and documented by Bjorn S. Nilsen
+// July 11 1999
+//
+// AliITS is the general base class for the ITS. Also see AliDetector for
+// futher information.
+//
///////////////////////////////////////////////////////////////////////////////
#include <TMath.h>
#include <TNode.h>
#include <TTUBE.h>
+#include "AliITSmodule.h"
+#include "AliDetector.h"
#include "AliITS.h"
+#include "TClonesArray.h"
+#include "TObjArray.h"
+#include "AliITShit.h"
+#include "AliITSdigit.h"
#include "AliRun.h"
ClassImp(AliITS)
//_____________________________________________________________________________
-AliITS::AliITS() : AliDetector()
-{
+AliITS::AliITS() : AliDetector(){
//
// Default initialiser for ITS
+ // The default constructor of the AliITS class. In addition to
+ // creating the AliITS class it zeros the variables fIshunt (a member
+ // of AliDetector class), fEuclidOut, and fIdN, and zeros the pointers
+ // fITSpoints, fIdSens, and fIdName. The AliDetector default constructor
+ // is also called.
//
- fIshunt = 0;
- fEuclidOut = 0;
+ fITSpoints = 0;
+ fIshunt = 0;
+ fEuclidOut = 0;
+ fIdN = 0;
+ fIdName = 0;
+ fIdSens = 0;
+
}
-
//_____________________________________________________________________________
-AliITS::AliITS(const char *name, const char *title)
- : AliDetector(name,title)
-{
+AliITS::AliITS(const char *name, const char *title):AliDetector(name,title){
//
// Default initialiser for ITS
+ // The constructor of the AliITS class. In addition to creating the
+ // AliITS class, it allocates memory for the TClonesArrays fHits and
+ // fDigits, and for the TObjArray fITSpoints. It also zeros the variables
+ // fIshunt (a member of AliDetector class), fEuclidOut, and fIdN, and zeros
+ // the pointers fIdSens and fIdName. To help in displaying hits via the ROOT
+ // macro display.C AliITS also sets the marker color to red. The variables
+ // passes with this constructor, const char *name and *title, are used by
+ // the constructor of AliDetector class. See AliDetector class for a
+ // description of these parameters and its constructor functions.
//
-
- fHits = new TClonesArray("AliITShit", 1560);
- fDigits = new TClonesArray("AliITSdigit",1000);
-
- fIshunt = 0;
- fEuclidOut = 0;
-
- fIdSens1 = fIdSens2 = fIdSens3 = fIdSens4 = fIdSens5 = fIdSens6 = 0;
-
+
+ fHits = new TClonesArray("AliITShit", 1560);
+ fDigits = new TClonesArray("AliITSdigit",1000);
+ fITSpoints = new TObjArray();
+// fITSmodules = new AliITSmodules();
+
+ fIshunt = 0;
+ fEuclidOut = 0;
+ fIdN = 0;
+ fIdName = 0;
+ fIdSens = 0;
+
SetMarkerColor(kRed);
+
}
//_____________________________________________________________________________
-AliITS::~AliITS()
-{
+AliITS::~AliITS(){
//
// Default distructor for ITS
+ // The default destructor of the AliITS class. In addition to deleting
+ // the AliITS class it deletes the memory pointed to by the fHits, fDigits,
+ // fIdSens, fIdName, and fITSpoints.
//
delete fHits;
delete fDigits;
+ if(fIdName!=0) delete[] fIdName;
+ if(fIdSens!=0) delete[] fIdSens;
+ delete fITSmodules;
+ if(fITSpoints!=0) delete fITSpoints;
}
//_____________________________________________________________________________
-void AliITS::AddDigit(Int_t *tracks, Int_t *digits)
-{
+void AliITS::AddDigit(Int_t *tracks, Int_t *digits){
//
// Add an ITS Digit
+ // The function to add information to the AliITSdigits class. See the
+ // AliITSdigits class for a full description. This function allocates the
+ // necessary new space for the digits information and passes the pointers
+ // *track and *digits to the AliITSdigits constructor function.
//
TClonesArray &ldigits = *fDigits;
new(ldigits[fNdigits++]) AliITSdigit(tracks,digits);
}
+Int_t AliITS::AddDigit(AliITSdigit* d) {
+
+ fDigits->Add(d);
+ fNdigits = fDigits->GetEntriesFast();
+ return fNdigits;
+}
+
//_____________________________________________________________________________
-void AliITS::AddHit(Int_t track, Int_t *vol, Float_t *hits)
-{
+void AliITS::AddHit(Int_t track, Int_t *vol, Float_t *hits){
//
// Add an ITS hit
+ // The function to add information to the AliITShit class. See the
+ // AliITShit class for a full description. This function allocates the
+ // necessary new space for the hit information and passes the variable
+ // track, and the pointers *vol and *hits to the AliITShit constructor
+ // function.
//
TClonesArray &lhits = *fHits;
new(lhits[fNhits++]) AliITShit(fIshunt,track,vol,hits);
}
-
//_____________________________________________________________________________
-void AliITS::BuildGeometry()
-{
+void AliITS::BuildGeometry(){
//
// Build ITS TNODE geometry for event display
+ // This function builds a simple ITS geometry used by the ROOT macro
+ // display.C. In general the geometry as coded is wrong.
//
TNode *Node, *Top;
const int kColorITS=kYellow;
Node->SetLineColor(kColorITS);
fNodes->Add(Node);
}
-
//_____________________________________________________________________________
-void AliITS::CreateMaterials()
-{
+void AliITS::CreateMaterials(){
//
// Create ITS materials
+ // This function defines the default materials used in the Geant
+ // Monte Carlo simulations. In general it is automatically replaced by
+ // the CreatMaterials routine defined in AliITSv?. Should the function
+ // CreateMaterials not exist for the geometry version you are using this
+ // one is used. See the definition found in AliITSv5 or the other routine
+ // for a complete definition.
//
-
+ // Water H2O
Float_t awat[2] = { 1.00794,15.9994 };
Float_t zwat[2] = { 1.,8. };
Float_t wwat[2] = { 2.,1. };
Float_t denswat = 1.;
+ // Freon
Float_t afre[2] = { 12.011,18.9984032 };
Float_t zfre[2] = { 6.,9. };
Float_t wfre[2] = { 5.,12. };
Float_t densfre = 1.5;
+ // Ceramics
// 94.4% Al2O3 , 2.8% SiO2 , 2.3% MnO , 0.5% Cr2O3
Float_t acer[5] = { 26.981539,15.9994,28.0855,54.93805,51.9961 };
Float_t zcer[5] = { 13.,8.,14.,25., 24. };
Float_t wcer[5] = { .49976,1.01233,.01307, .01782,.00342 };
Float_t denscer = 3.6;
+ //
// 60% SiO2 , 40% G10FR4
+ // PC board
Float_t apcb[3] = { 28.0855,15.9994,17.749 };
Float_t zpcb[3] = { 14.,8.,8.875 };
Float_t wpcb[3] = { .28,.32,.4 };
Float_t denspcb = 1.8;
+ // POLYETHYL
Float_t apoly[2] = { 12.01,1. };
Float_t zpoly[2] = { 6.,1. };
Float_t wpoly[2] = { .33,.67 };
+ // SERVICES
Float_t zserv[4] = { 1.,6.,26.,29. };
Float_t aserv[4] = { 1.,12.,55.8,63.5 };
Float_t wserv[4] = { .014,.086,.42,.48 };
- Int_t ISXFLD = gAlice->Field()->Integ();
+ Int_t ISXFLD = gAlice->Field()->Integ();
Float_t SXMGMX = gAlice->Field()->Max();
// --- Define the various materials for GEANT ---
- // 200-224 --> Silicon Pixel Detectors (detectors, chips, buses, cooling,..)
+ // 200-224 --> Silicon Pixel Detectors (detectors, chips, buses, cooling,..)
AliMaterial(0, "SPD Si$", 28.0855, 14., 2.33, 9.36, 999);
AliMaterial(1, "SPD Si chip$", 28.0855, 14., 2.33, 9.36, 999);
AliMixture( 7, "SPD Water $", awat, zwat, denswat, -2, wwat);
AliMixture( 8, "SPD Freon$", afre, zfre, densfre, -2, wfre);
// **
- AliMedium(0, "SPD Si$", 0, 1, ISXFLD, SXMGMX, 10., .01, .1, .003, .003);
- AliMedium(1, "SPD Si chip$", 1, 0, ISXFLD, SXMGMX, 10., .01, .1, .003, .003);
- AliMedium(2, "SPD Si bus$", 2, 0, ISXFLD, SXMGMX, 10., .01, .1, .003, .003);
- AliMedium(3, "SPD C$", 3, 0, ISXFLD, SXMGMX, 10., .01, .1, .003, .003);
- AliMedium(4, "SPD Air$", 4, 0, ISXFLD, SXMGMX, 10., .01, .1, .003, .003);
- AliMedium(5, "SPD Vacuum$", 5, 0, ISXFLD, SXMGMX, 10., 1., .1, .1, 10.);
- AliMedium(6, "SPD Al$", 6, 0, ISXFLD, SXMGMX, 10., .01, .1, .003, .003);
- AliMedium(7, "SPD Water $", 7, 0, ISXFLD, SXMGMX, 10., .01, .1, .003, .003);
- AliMedium(8, "SPD Freon$", 8, 0, ISXFLD, SXMGMX, 10., .01, .1, .003, .003);
+ AliMedium(0, "SPD Si$", 0, 1,ISXFLD,SXMGMX, 10., .01, .1, .003, .003);
+ AliMedium(1, "SPD Si chip$", 1, 0,ISXFLD,SXMGMX, 10., .01, .1, .003, .003);
+ AliMedium(2, "SPD Si bus$", 2, 0,ISXFLD,SXMGMX, 10., .01, .1, .003, .003);
+ AliMedium(3, "SPD C$", 3, 0,ISXFLD,SXMGMX, 10., .01, .1, .003, .003);
+ AliMedium(4, "SPD Air$", 4, 0,ISXFLD,SXMGMX, 10., .01, .1, .003, .003);
+ AliMedium(5, "SPD Vacuum$", 5, 0,ISXFLD,SXMGMX, 10.,1.00, .1, .100,10.00);
+ AliMedium(6, "SPD Al$", 6, 0,ISXFLD,SXMGMX, 10., .01, .1, .003, .003);
+ AliMedium(7, "SPD Water $", 7, 0,ISXFLD,SXMGMX, 10., .01, .1, .003, .003);
+ AliMedium(8, "SPD Freon$", 8, 0,ISXFLD,SXMGMX, 10., .01, .1, .003, .003);
- // 225-249 --> Silicon Drift Detectors (detectors, chips, buses, cooling,..)
+ // 225-249 --> Silicon Drift Detectors (detectors, chips, buses, cooling,..)
AliMaterial(25, "SDD Si$", 28.0855, 14., 2.33, 9.36, 999);
AliMaterial(26, "SDD Si chip$", 28.0855, 14., 2.33, 9.36, 999);
AliMaterial(37, "SDD Kapton$", 12.011, 6., 1.3, 31.27, 999);
// **
// check A and Z
- AliMedium(25, "SDD Si$", 25, 1, ISXFLD, SXMGMX, 10., .01, .1, .003, .003);
- AliMedium(26, "SDD Si chip$", 26, 0, ISXFLD, SXMGMX, 10., .01, .1, .003, .003);
- AliMedium(27, "SDD Si bus$", 27, 0, ISXFLD, SXMGMX, 10., .01, .1, .003, .003);
- AliMedium(28, "SDD C$", 28, 0, ISXFLD, SXMGMX, 10., .01, .1, .003, .003);
- AliMedium(29, "SDD Air$", 29, 0, ISXFLD, SXMGMX, 10., .01, .1, .003, .003);
- AliMedium(30, "SDD Vacuum$", 30, 0, ISXFLD, SXMGMX, 10., 1., .1, .1, 10.);
- AliMedium(31, "SDD Al$", 31, 0, ISXFLD, SXMGMX, 10., .01, .1, .003, .003);
- AliMedium(32, "SDD Water $", 32, 0, ISXFLD, SXMGMX, 10., .01, .1, .003, .003);
- AliMedium(33, "SDD Freon$", 33, 0, ISXFLD, SXMGMX, 10., .01, .1, .003, .003);
- AliMedium(34, "SDD PCB$", 34, 0, ISXFLD, SXMGMX, 10., .01, .1, .003, .003);
- AliMedium(35, "SDD Copper$", 35, 0, ISXFLD, SXMGMX, 10., .01, .1, .003, .003);
- AliMedium(36, "SDD Ceramics$",36, 0, ISXFLD, SXMGMX, 10., .01, .1, .003, .003);
- AliMedium(37, "SDD Kapton$", 37, 0, ISXFLD, SXMGMX, 10., .01, .1, .003, .003);
+ AliMedium(25, "SDD Si$", 25, 1,ISXFLD,SXMGMX, 10., .01, .1, .003, .003);
+ AliMedium(26, "SDD Si chip$", 26, 0,ISXFLD,SXMGMX, 10., .01, .1, .003, .003);
+ AliMedium(27, "SDD Si bus$", 27, 0,ISXFLD,SXMGMX, 10., .01, .1, .003, .003);
+ AliMedium(28, "SDD C$", 28, 0,ISXFLD,SXMGMX, 10., .01, .1, .003, .003);
+ AliMedium(29, "SDD Air$", 29, 0,ISXFLD,SXMGMX, 10., .01, .1, .003, .003);
+ AliMedium(30, "SDD Vacuum$", 30, 0,ISXFLD,SXMGMX, 10.,1.00, .1, .100,10.00);
+ AliMedium(31, "SDD Al$", 31, 0,ISXFLD,SXMGMX, 10., .01, .1, .003, .003);
+ AliMedium(32, "SDD Water $", 32, 0,ISXFLD,SXMGMX, 10., .01, .1, .003, .003);
+ AliMedium(33, "SDD Freon$", 33, 0,ISXFLD,SXMGMX, 10., .01, .1, .003, .003);
+ AliMedium(34, "SDD PCB$", 34, 0,ISXFLD,SXMGMX, 10., .01, .1, .003, .003);
+ AliMedium(35, "SDD Copper$", 35, 0,ISXFLD,SXMGMX, 10., .01, .1, .003, .003);
+ AliMedium(36, "SDD Ceramics$",36, 0,ISXFLD,SXMGMX, 10., .01, .1, .003, .003);
+ AliMedium(37, "SDD Kapton$", 37, 0,ISXFLD,SXMGMX, 10., .01, .1, .003, .003);
- // 250-274 --> Silicon Strip Detectors (detectors, chips, buses, cooling,..)
+ // 250-274 --> Silicon Strip Detectors (detectors, chips, buses, cooling,..)
AliMaterial(50, "SSD Si$", 28.0855, 14., 2.33, 9.36, 999.);
AliMaterial(51, "SSD Si chip$", 28.0855, 14., 2.33, 9.36, 999.);
// check A and Z
AliMaterial(63, "SDD G10FR4$", 17.749, 8.875, 1.8, 21.822, 999.);
// **
- AliMedium(50, "SSD Si$", 50, 1, ISXFLD, SXMGMX, 10., .01, .1, .003, .003);
- AliMedium(51, "SSD Si chip$", 51, 0, ISXFLD, SXMGMX, 10., .01, .1, .003, .003);
- AliMedium(52, "SSD Si bus$", 52, 0, ISXFLD, SXMGMX, 10., .01, .1, .003, .003);
- AliMedium(53, "SSD C$", 53, 0, ISXFLD, SXMGMX, 10., .01, .1, .003, .003);
- AliMedium(54, "SSD Air$", 54, 0, ISXFLD, SXMGMX, 10., .01, .1, .003, .003);
- AliMedium(55, "SSD Vacuum$", 55, 0, ISXFLD, SXMGMX, 10., 1., .1, .1, 10.);
- AliMedium(56, "SSD Al$", 56, 0, ISXFLD, SXMGMX, 10., .01, .1, .003, .003);
- AliMedium(57, "SSD Water $", 57, 0, ISXFLD, SXMGMX, 10., .01, .1, .003, .003);
- AliMedium(58, "SSD Freon$", 58, 0, ISXFLD, SXMGMX, 10., .01, .1, .003, .003);
- AliMedium(59, "SSD PCB$", 59, 0, ISXFLD, SXMGMX, 10., .01, .1, .003, .003);
- AliMedium(60, "SSD Copper$", 60, 0, ISXFLD, SXMGMX, 10., .01, .1, .003, .003);
- AliMedium(61, "SSD Ceramics$",61, 0, ISXFLD, SXMGMX, 10., .01, .1, .003, .003);
- AliMedium(62, "SSD Kapton$", 62, 0, ISXFLD, SXMGMX, 10., .01, .1, .003, .003);
- AliMedium(63, "SSD G10FR4$", 63, 0, ISXFLD, SXMGMX, 10., .01, .1, .003, .003);
+ AliMedium(50, "SSD Si$", 50, 1,ISXFLD,SXMGMX, 10., .01, .1, .003, .003);
+ AliMedium(51, "SSD Si chip$", 51, 0,ISXFLD,SXMGMX, 10., .01, .1, .003, .003);
+ AliMedium(52, "SSD Si bus$", 52, 0,ISXFLD,SXMGMX, 10., .01, .1, .003, .003);
+ AliMedium(53, "SSD C$", 53, 0,ISXFLD,SXMGMX, 10., .01, .1, .003, .003);
+ AliMedium(54, "SSD Air$", 54, 0,ISXFLD,SXMGMX, 10., .01, .1, .003, .003);
+ AliMedium(55, "SSD Vacuum$", 55, 0,ISXFLD,SXMGMX, 10.,1.00, .1, .100,10.00);
+ AliMedium(56, "SSD Al$", 56, 0,ISXFLD,SXMGMX, 10., .01, .1, .003, .003);
+ AliMedium(57, "SSD Water $", 57, 0,ISXFLD,SXMGMX, 10., .01, .1, .003, .003);
+ AliMedium(58, "SSD Freon$", 58, 0,ISXFLD,SXMGMX, 10., .01, .1, .003, .003);
+ AliMedium(59, "SSD PCB$", 59, 0,ISXFLD,SXMGMX, 10., .01, .1, .003, .003);
+ AliMedium(60, "SSD Copper$", 60, 0,ISXFLD,SXMGMX, 10., .01, .1, .003, .003);
+ AliMedium(61, "SSD Ceramics$",61, 0,ISXFLD,SXMGMX, 10., .01, .1, .003, .003);
+ AliMedium(62, "SSD Kapton$", 62, 0,ISXFLD,SXMGMX, 10., .01, .1, .003, .003);
+ AliMedium(63, "SSD G10FR4$", 63, 0,ISXFLD,SXMGMX, 10., .01, .1, .003, .003);
// 275-299 --> General (end-caps, frames, cooling, cables, etc.)
// positive
AliMixture(81, "GEN Water $", awat, zwat, denswat, 2, wwat);
// **
- AliMedium(75, "GEN C$", 75, 0, ISXFLD, SXMGMX, 10., .01, .1, .003, .003);
- AliMedium(76, "GEN Air$", 76, 0, ISXFLD, SXMGMX, 10., .01, .1, .003, .003);
- AliMedium(77, "GEN Vacuum$", 77, 0, ISXFLD, SXMGMX, 10., .1, .1, .1, 10.);
- AliMedium(78, "GEN POLYETHYL$", 78, 0, ISXFLD, SXMGMX, 10., .01, .1, .003, .003);
- AliMedium(79, "GEN SERVICES$", 79, 0, ISXFLD, SXMGMX, 10., .01, .1, .003, .003);
- AliMedium(80, "GEN Copper$", 80, 0, ISXFLD, SXMGMX, 10., .01, .1, .003, .003);
- AliMedium(81, "GEN Water $", 81, 0, ISXFLD, SXMGMX, 10., .01, .1, .003, .003);
+ AliMedium(75,"GEN C$", 75, 0,ISXFLD,SXMGMX, 10., .01, .1, .003, .003);
+ AliMedium(76,"GEN Air$", 76, 0,ISXFLD,SXMGMX, 10., .01, .1, .003, .003);
+ AliMedium(77,"GEN Vacuum$", 77, 0,ISXFLD,SXMGMX, 10., .10, .1, .100,10.00);
+ AliMedium(78,"GEN POLYETHYL$",78, 0,ISXFLD,SXMGMX, 10., .01, .1, .003, .003);
+ AliMedium(79,"GEN SERVICES$", 79, 0,ISXFLD,SXMGMX, 10., .01, .1, .003, .003);
+ AliMedium(80,"GEN Copper$", 80, 0,ISXFLD,SXMGMX, 10., .01, .1, .003, .003);
+ AliMedium(81,"GEN Water $", 81, 0,ISXFLD,SXMGMX, 10., .01, .1, .003, .003);
}
//_____________________________________________________________________________
-Int_t AliITS::DistancetoPrimitive(Int_t , Int_t )
-{
+Int_t AliITS::DistancetoPrimitive(Int_t , Int_t ){
//
// Distance from mouse to ITS on the screen. Dummy routine
+ // A dummy routine used by the ROOT macro display.C to allow for the
+ // use of the mouse (pointing device) in the macro. In general this should
+ // never be called. If it is it returns the number 9999 for any value of
+ // x and y.
//
return 9999;
}
//_____________________________________________________________________________
-void AliITS::Init()
-{
+void AliITS::Init(){
//
// Initialise ITS after it has been built
+ // This routine initializes the AliITS class. It is intended to be called
+ // from the Init function in AliITSv?. Besides displaying a banner
+ // indicating that it has been called it initializes the array fIdSens.
+ // Therefore it should be called after a call to CreateGeometry.
//
Int_t i;
//
printf("\n");
//
//
- fIdSens1=gMC->VolId("ITS1");
- fIdSens2=gMC->VolId("ITS2");
- fIdSens3=gMC->VolId("ITS3");
- fIdSens4=gMC->VolId("ITS4");
- fIdSens5=gMC->VolId("ITS5");
- fIdSens6=gMC->VolId("ITS6");
+ for(i=0;i<fIdN;i++) fIdSens[i] = gMC->VolId(fIdName[i]);
//
for(i=0;i<80;i++) printf("*");
printf("\n");
}
//_____________________________________________________________________________
-void AliITS::MakeBranch(Option_t* option)
-{
+void AliITS::MakeBranch(Option_t* option){
//
// Create Tree branches for the ITS.
+ // Creates the TTree branch where the class AliITS is kept.
//
Int_t buffersize = 4000;
char branchname[10];
if (fDigits && gAlice->TreeD() && D) {
gAlice->TreeD()->Branch(branchname,&fDigits, buffersize);
printf("Making Branch %s for digits\n",branchname);
- }
-}
-
-//_____________________________________________________________________________
-void AliITS::SetEUCLID(Bool_t euclid)
-{
- //
- // set euclid output flag
- //
- fEuclidOut=euclid;
-}
-
-ClassImp(AliITShit)
-
-//_____________________________________________________________________________
-AliITShit::AliITShit(Int_t shunt, Int_t track, Int_t *vol, Float_t *hits):
- AliHit(shunt, track)
-{
- //
- // Create ITS hit
- //
- fLayer = vol[0]; // Layer number
- fLadder = vol[2]; // Ladder number
- fDet = vol[1]; // Detector number
- fX = hits[0];
- fY = hits[1];
- fZ = hits[2];
- fPx = hits[3];
- fPy = hits[4];
- fPz = hits[5];
- fDestep = hits[6];
+ } // end if
}
-ClassImp(AliITSdigit)
-
-//_____________________________________________________________________________
-AliITSdigit::AliITSdigit(Int_t *tracks, Int_t *digits):
- AliDigit(tracks)
-{
- //
- // Create ITS digit
- //
- fEvent = digits[0];
- fLayer = digits[1];
- fDet = digits[2];
- fNoverl = digits[3];
+//____________________________________________________________________________
+void AliITS::Streamer(TBuffer &R__b){
+ // Stream an object of class AliITS.
+ Int_t i,j,l;
+
+ if (R__b.IsReading()) {
+ Version_t R__v = R__b.ReadVersion();
+ if (R__v == 1) {
+ AliDetector::Streamer(R__b);
+ R__b >> fITSgeom;
+// R__b >> fITSmodules; //We do not write out modules so don't read them
+ R__b >> fITSpoints;
+ R__b >> fEuclidOut;
+ R__b >> fIdN;
+ if(fIdSens!=0) delete[] fIdSens;
+ if(fIdName!=0) delete[] fIdName;
+ fIdSens = new Int_t[fIdN];
+ fIdName = new char*[fIdN];
+ for(i=0;i<fIdN;i++) R__b >> fIdSens[i];
+ for(i=0;i<fIdN;i++){
+ R__b >> l;
+ fIdName[i] = new char[l+1]; // add room for null character.
+ for(j=0;j<l;j++) R__b >> fIdName[i][j];
+ fIdName[i][l] = '\0'; // Null terminate this string.
+ } // end for i
+ R__b >> fMajorVersion;
+ R__b >> fMinorVersion;
+ } // end if (R__v)
+ } else {
+ R__b.WriteVersion(AliITS::IsA());
+ AliDetector::Streamer(R__b);
+ R__b << fITSgeom;
+// R__b << fITSmodules; //We don't want to write out the modules class.
+ R__b << fITSpoints;
+ R__b << fEuclidOut;
+ R__b << fIdN;
+ for(i=0;i<fIdN;i++) R__b <<fIdSens[i];
+ for(i=0;i<fIdN;i++){
+ l = strlen(fIdName[i]);
+ R__b << l;
+ for(j=0;j<l;j++) R__b << fIdName[i][j];
+ } // end for i
+ R__b << fMajorVersion;
+ R__b << fMinorVersion;
+ }
}
#ifndef ITS_H
#define ITS_H
-////////////////////////////////////////////////
-// Manager and hits classes for set: ITS //
-////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////
+// Manager and hits classes for set: ITS //
+////////////////////////////////////////////////////////////////////////
+#include "TObjArray.h"
#include "AliDetector.h"
-#include "AliHit.h"
-#include "AliDigit.h"
+#include "AliITSgeom.h"
+#include "AliITSdigit.h"
+#include "AliITSmodule.h"
class AliITS : public AliDetector {
-
-protected:
-
- Bool_t fEuclidOut;
-
- Int_t fIdSens1; //First layer identifier
- Int_t fIdSens2; //Second layer identifier
- Int_t fIdSens3; //Third layer identifier
- Int_t fIdSens4; //Fourth layer identifier
- Int_t fIdSens5; //Fifth layer identifier
- Int_t fIdSens6; //Sixth layer identifier
-
-public:
- AliITS();
- AliITS(const char *name, const char *title);
- virtual ~AliITS();
- virtual void AddHit(Int_t, Int_t*, Float_t*);
- virtual void AddDigit(Int_t*, Int_t*);
- virtual void BuildGeometry();
- virtual void CreateGeometry() {}
- virtual void CreateMaterials();
- virtual Int_t IsVersion() const =0;
- Int_t DistancetoPrimitive(Int_t px, Int_t py);
- virtual void Init();
- virtual void MakeBranch(Option_t *opt=" ");
- virtual void SetEUCLID(Bool_t euclid=1);
- virtual void StepManager()=0;
-
- ClassDef(AliITS,1) //Hits manager for set:ITS
-};
+////////////////////////////////////////////////////////////////////////
+//
+// An overview of the basic philosophy of the ITS code development
+// and analysis is show in the figure below.
+//Begin_Html
+/*
+<img src="figures/ITS_Analysis_schema.gif">
+</pre>
+<br clear=left>
+<font size=+2 color=red>
+<p>Roberto Barbera is in charge of the ITS Offline code (1999).
+<a href="mailto:roberto.barbera@ct.infn.it">Roberto Barbera</a>.
+</font>
+<pre>
+*/
+//End_Html
+//
+// Version: 0
+// Written by Rene Brun, Federico Carminati, and Roberto Barbera
+//
+// Version: 1
+// Modified and documented by Bjorn S. Nilsen
+// July 11 1999
+//
+// AliITS is the general base class for the ITS. Also see AliDetector for
+// futher information.
+//
+// Data members:
+//
+// AliITSgeom *fITSgeom
+// All of the geometry information about the active volumes that
+// make up the ITS are described in the AliITSgeom class. This includes
+// the transformation functions between the local and global coordinate
+// systems and the like. See the full description found in the AliITSgeom
+// class. Here in the AliITS class is kept the pointer to the geometry
+// used in the simulations or that thought to be the correct one for the
+// data. Until a more general class is define and a more appropriate
+// place is found to keep this geometry information, it is kept here in
+// AliITS.
+//
+// TObjArray *fITSpoints
+// This is a pointer to the points, to be used by the tracking algorithms
+// for example, found in the detectors of the ITS. To allow for the most
+// general points structure it is defined to be a pointer to a TObjArray where
+// each array element would be one point found in the ITS detectors. An
+// Addpoints function is defined below. By default an array of 16 TObjects are
+// defined during the initialization of AliITS. This is automatically expanded
+// when necessary by the Addpoints function.
+//
+// Bool_t fEuclidOut
+// This is a flag used to indicate that an Euclid compatible CAD
+// file will be created upon the creation of the ITS Monte Carlo
+// geometry definition, in the function CreatGeometry. If fEuclidOut is
+// true, then a file called ITSgeometry.euc will be created.
+//
+// Int_t fIdN
+// This variable contains the number of layers defined in the ITS
+// geometry. It is primarily used as a size indicator for fIdSens and
+// fIdName described below. In general the number of layers, ladders, or
+// detectors should be gotten from the AliITSgeom functions. Upon
+// creating the AliITS object it is set to zero.
+//
+// Int_t *fIdSens
+// This is a pointer to an array containing the Monte Carlo volume
+// numbers for the different layers of the ITS. These numbers are needed
+// by the StepManager function to determine what layer a hit was on. It
+// is sized and initialized in the Init function and the AliITSv? Init
+// function, called after a call to CreateGeometry. Upon creating the
+// AliITS object it points to zero. This variable is made a pointer
+// in order to keep the maximum flexibility at this level of the code.
+//
+// char **fIdName
+// This is a pointer to an array of characters containing the names of
+// the different ITS layers as defined in the Monte Carlo geometry data-
+// base. It is sized and filled in the AliITSv? Init function, called
+// after a call to CreatGeometry. Upon creating the AliITS object it
+// points to zero. This variable is make a pointer in order to keep the
+// maximum flexibility at this level of the code.
+//
+// Member Functions:
+//
+// AliITS()
+// The default constructor of the AliITS class. In addition to
+// creating the AliITS class it zeros the variables fIshunt (a member
+// of AliDetector class), fEuclidOut, and fIdN, and zeros the pointers
+// fITSpoints, fIdSens, and fIdName. The AliDetector default constructor
+// is also called.
+//
+// AliITS(const char *name, const char *title)
+// The constructor of the AliITS class. In addition to creating the
+// AliITS class, it allocates memory for the TClonesArrays fHits and
+// fDigits, and for the TObjArray fITSpoints. It also zeros the variables
+// fIshunt (a member of AliDetector class), fEuclidOut, and fIdN, and zeros
+// the pointers fIdSens and fIdName. To help in displaying hits via the ROOT
+// macro display.C AliITS also sets the marker color to red. The variables
+// passes with this constructor, const char *name and *title, are used by
+// the constructor of AliDetector class. See AliDetector class for a
+// description of these parameters and its constructor functions.
+//
+// ~AliITS()
+// The default destructor of the AliITS class. In addition to deleting
+// the AliITS class it deletes the memory pointed to by the fHits, fDigits,
+// fIdSens, fIdName, and fITSpoints.
+//
+// AddHit(Int_t track, Int_t *vol, Float_t *hits)
+// The function to add information to the AliITShit class. See the
+// AliITShit class for a full description. This function allocates the
+// necessary new space for the hit information and passes the variable
+// track, and the pointers *vol and *hits to the AliITShit constructor
+// function.
+//
+// AddDigit(Int_t *track, Int_t *digits)
+// The function to add information to the AliITSdigits class. See the
+// AliITSdigits class for a full description. This function allocates the
+// necessary new space for the digits information and passes the pointers
+// *track and *digits to the AliITSdigits constructor function.
+//
+// BuildGeometry()
+// This function builds a simple ITS geometry used by the ROOT macro
+// display.C. In general the geometry as coded is wrong.
+//
+// CreateGeometry()
+// This function builds the detailed geometry used by the Geant
+// Monte Carlo. As defined here it is a dummy routine to be replaced
+// by the version coded up in AliITSv? where the specific geometry to
+// be used by the simulation is defined. See the definition of AliITSv5
+// or the other routines for a complete definition.
+//
+// CreateMaterials()
+// This function defines the default materials used in the Geant
+// Monte Carlo simulations. In general it is automatically replaced by
+// the CreatMaterials routine defined in AliITSv?. Should the function
+// CreateMaterials not exist for the geometry version you are using this
+// one is used. See the definition found in AliITSv5 or the other routine
+// for a complete definition.
+//
+// IsVersion()
+// Returns the version number of the AliITS class. At present it is
+// version 1.
+//
+// DistancetoPrimitive(Int_t x, Int_t y)
+// A dummy routine used by the ROOT macro display.C to allow for the
+// use of the mouse (pointing device) in the macro. In general this should
+// never be called. If it is it returns the number 9999 for any value of
+// x and y.
+//
+// Init()
+// This routine initializes the AliITS class. It is intended to be called
+// from the Init function in AliITSv?. Besides displaying a banner
+// indicating that it has been called it initializes the array fIdSens.
+// Therefore it should be called after a call to CreateGeometry.
+//
+// MakeBranch(Option_t *Opt=" ")
+// Creates the TTree branch where the class AliITS is kept.
+//
+// SetEUCLID(bool_t euclid=1)
+// Sets the flag fEuclidOut to true (default) of false (euclid=0).
+// By setting or clearing the fEuclidOut flag you can controls whether
+// or not a euclid formatted output file of the ITS geometry is written.
+// If fEuclidOut is set true then a file called ITSgeometry.euc will be
+// written after the ITS geometry is defined in the Monte Carlo. If
+// fEuclidOut is set false then no file is created.
+//
+// StepManager()
+// Dummy routine which is replaced by the routine StepManager() defined
+// in AliITSv?. If no such routine exist then this routine returns zero.
+// See AliITSv? for a detailed description of the step manager routines.
+//
+// GetITSgeom()
+// Returns the value of the pointer fITSgeom. This is used to get
+// access to the ITS geometry stored in the file. See AliITSgeom for a
+// full description of the geometry package.
+//
+// GetITSpoints()
+// Returns the value of the pointer fITSpoints. This is used to get
+// access to the ITS cluster objects, if filled, stored in the file. See
+// AliITSCluster for a full description of the cluster data.
+////////////////////////////////////////////////////////////////////////
+ protected:
+ AliITSgeom *fITSgeom; // Pointer to ITS geometry
+ TObjArray *fITSmodules; // Pointer to ITS modules
+ // Defined here since it doesn't have a place in AliDetector like fDigit
+ TObjArray *fITSpoints; // Pointer to ITS points
-
-//___________________________________________
-class AliITSdigit: public AliDigit {
-public:
- Int_t fEvent; // Event number
- Int_t fLayer; // Layer number
- Int_t fDet ; // Detector number
- Int_t fNoverl; // Number of overflow
-
-public:
- AliITSdigit() {}
- AliITSdigit(Int_t *tracks, Int_t *digits);
- virtual ~AliITSdigit() {}
-
- ClassDef(AliITSdigit,1) //Digit (Header) object for set:ITS
-};
-
-//___________________________________________
-
-class AliITShit : public AliHit {
-public:
- Int_t fLayer; // Layer number
- Int_t fLadder; // Ladder number
- Int_t fDet; // Detector number
- Float_t fPx ; //PX
- Float_t fPy ; //PY
- Float_t fPz ; //PZ
- Float_t fDestep; // Energy deposited in the current step
-public:
- AliITShit() {}
- AliITShit(Int_t shunt, Int_t track, Int_t *vol, Float_t *hits);
- virtual ~AliITShit() {}
-
- ClassDef(AliITShit,1) //Hits object for set:ITS
+ Bool_t fEuclidOut; // Flag to write out geometry in euclid format
+ Int_t fIdN; // the number of layers
+ Int_t *fIdSens; char **fIdName; //layer identifier
+ // Geometry and Stepmanager version numbers used.
+ Int_t fMajorVersion,fMinorVersion;
+
+ public:
+ AliITS();
+ AliITS(const char *name, const char *title);
+ virtual ~AliITS();
+
+ virtual void AddHit(Int_t, Int_t*, Float_t*);
+ virtual void AddDigit(Int_t*, Int_t*);
+ virtual Int_t AddDigit(AliITSdigit *d);
+// virtual void AddPoint(); // yet to be defined
+
+ virtual void BuildGeometry();
+ virtual void CreateGeometry() {};
+ virtual void CreateMaterials();
+
+ inline virtual TObjArray* GetModules() {return fITSmodules;}
+ inline virtual TObjArray* GetPoints(){return fITSpoints;}
+
+ inline void GetGeometryVersion(Int_t &a,Int_t &b)
+ {a = fMajorVersion;b=fMinorVersion;return;}
+ inline virtual Int_t IsVersion() {return 1;}
+ Int_t DistancetoPrimitive(Int_t px, Int_t py);
+ virtual void Init();
+ virtual void MakeBranch(Option_t *opt=" ");
+ inline virtual void SetEUCLID(Bool_t euclid=1){fEuclidOut = euclid;}
+ virtual void StepManager()=0;
+ //
+ // ITS geometry functions
+ inline virtual AliITSgeom *GetITSgeom(){return fITSgeom;}
+ inline virtual TObjArray *GetITSpoints(){return fITSpoints;}
+
+ ClassDef(AliITS,1)
};
-
#endif
--- /dev/null
+//
+#include "AliITS.h"
+#include "AliITSdigit.h"
+#include "AliRun.h"
+////////////////////////////////////////////////////////////////////////
+// Version: 0
+// Written by Rene Brun, Federico Carminati, and Roberto Barbera
+// Minor modifications made and documented by Bjorn S. Nilsen
+// July 11 1999
+//
+// The default ITS digit structure. This should either be replaced
+// or added on to later with the proper digit structure defined for
+// each detector type. See the proposed Digit structure defined by
+// Bjorn S. Nilsen for an example.
+//Begin_Html
+/*
+<img src="figures/AliITShit_Class_Diagram.gif">
+</pre>
+<br clear=left>
+<font size=+2 color=red>
+<p>This show the relasionships between the ITS digit class' and the rest of Aliroot.
+</font>
+<pre>
+*/
+//End_Html
+//_____________________________________________________________________________
+ClassImp(AliITSdigit)
+
+AliITSdigit::AliITSdigit(Int_t *tracks, Int_t *digits):
+ AliDigit(tracks){
+ //
+ // Create ITS digit
+ // The creator for the AliITSdigit class. This routine fills the
+ // AliITSdigit data members from the array digits. The array of track
+ // numbers are passed to the AliDigit creator. The order of the elements
+ // in the digits array are fEvent = digits[0], fLayer = digits[1],
+ // fLadder = digits[2], fDet = digits[3], and fNoverl = digits[4].
+ // Therefore the array digits is expected to be at least 5 elements long.
+ //
+ fEvent = digits[0];
+ fLayer = digits[1];
+ fLadder = digits[2];
+ fDet = digits[3];
+ fNoverl = digits[4];
+}
--- /dev/null
+#ifndef ITSDIGIT_H
+#define ITSDIGIT_H
+
+#include "AliDigit.h"
+#include "AliITS.h"
+#include "AliITSgeom.h"
+
+//___________________________________________
+class AliITSdigit: public AliDigit {
+////////////////////////////////////////////////////////////////////////
+// Version: 0
+// Written by Rene Brun, Federico Carminati, and Roberto Barbera
+// Minor modifications made and documented by Bjorn S. Nilsen
+// July 11 1999
+//
+// The default ITS digit structure. This should either be replaced
+// or added on to later with the proper digit structure defined for
+// each detector type. See the proposed Digit structure defined by
+// Bjorn S. Nilsen for an example.
+//
+// Data members:
+//
+// Int_t fTracks[3]
+// See AliDigit for a full description. The track numbers, up to 3,
+// that make up this digit.
+//
+// Int_t fEvent
+// The event number for this digit. This information is probably
+// kept someplace else already (via the TTree structure already in use).
+//
+// Int_t fLayer
+// The layer number of this digit. This is part of the information
+// that determines the detector where this digit is located (layer, ladder,
+// and detector numbers).
+//
+// Int_t fLadder
+// The ladder number of this digit. This is part of the information
+// that determines the detector where this digit is located (layer, ladder,
+// and detector numbers).
+//
+// Int_t fDet
+// The detector number of this digit. This is part of the information
+// that determines the detector where this digit is located (layer, ladder,
+// and detector numbers).
+//
+// Int_t fNoverl
+// The number of hits that make up this digit.
+//
+// Member functions:
+//
+// int *GetTracks()
+// See AliDigit for a full description. Returns a pointer to the
+// array fTracks where the tracks number of the tracks that make up
+// this digit are stored.
+//
+// AliITSdigit()
+// The default creator for the AliITSdigit class.
+//
+// AliITSdigit(Int_t *tracks, Int_t *digits)
+// The creator for the AliITSdigit class. This routine fills the
+// AliITSdigit data members from the array digits. The array of track
+// numbers are passed to the AliDigit creator. The order of the elements
+// in the digits array are fEvent = digits[0], fLayer = digits[1],
+// fLadder = digits[2], fDet = digits[3], and fNoverl = digits[4].
+// Therefore the array digits is expected to be at least 5 elements long.
+//
+// ~AliITSdigit()
+// The destructor for the AliITSdigit class. At present the default
+// destructor is used.
+////////////////////////////////////////////////////////////////////////
+ public:
+ Int_t fEvent; // Event number
+ Int_t fLayer; // Layer number
+ Int_t fLadder; // Ladder number
+ Int_t fDet; // Detector number
+ Int_t fNoverl; // Number of overflow
+
+ public:
+ AliITSdigit() {}
+ AliITSdigit(Int_t *tracks, Int_t *digits);
+ virtual ~AliITSdigit() {}
+
+ ClassDef(AliITSdigit,1) //Digit (Header) object for set:ITS
+};
+#endif
--- /dev/null
+#include "AliITSdigitSSD.h"
+
+ClassImp(AliITSdigitSSD);
+
+AliITSdigitSSD::AliITSdigitSSD
+ (Int_t *tracks, Int_t *digits, Int_t strNo, Int_t s, Bool_t p)
+ :AliITSdigit(tracks,digits) {
+
+ fSignal = s;
+ fStripNumber = strNo;
+ fSide = p;
+}
+
--- /dev/null
+#ifndef AliITSDIGITSSD_H
+#define AliITSDIGITSSD_H
+
+#include "AliITS.h"
+
+class AliITSdigitSSD: public AliITSdigit {
+
+protected:
+ Bool_t fSide; //true if P side
+ Int_t fStripNumber; //Number of Strip
+ Int_t fSignal; //Signal on ADC
+
+public:
+
+ AliITSdigitSSD() {};
+ ~AliITSdigitSSD() {};
+ AliITSdigitSSD(Int_t *tracks, Int_t *digits, Int_t strNo, Int_t s, Bool_t p);
+
+ // Methods for accesing signal on strip
+ inline void SetSignal(Int_t s) {fSignal = s;}
+ inline Int_t GetSignal() {return fSignal;}
+
+ // Methods for accesing strip number
+ inline Int_t GetStripNumber() {return fStripNumber;};
+ inline void SetStripNumber(Int_t s) {fStripNumber = s;};
+
+ // Methods for accesing side of the strip P/N
+ inline Bool_t IsSideP() {return fSide;}; //returns true when side P
+ inline void SetSideP(Bool_t b) {fSide = b;}; //set side of digit
+
+ ClassDef(AliITSdigitSSD, 1)
+};
+
+#endif
--- /dev/null
+///////////////////////////////////////////////////////////////////////
+// ITS geometry manimulaiton routines. //
+// Created April 15 1999. //
+// version: 0.0.0 //
+// By: Bjorn S. Nilsen //
+// version: 0.0.1 //
+// Updated May 27 1999. //
+// Added Cylinderical random and global based changes. //
+// Added function PrintComparison. //
+///////////////////////////////////////////////////////////////////////
+#include <iostream.h>
+#include <fstream.h>
+#include <iomanip.h>
+#include <stdio.h>
+#include "AliITSgeom.h"
+#include "TRandom.h"
+
+ClassImp(AliITSgeom)
+
+//_____________________________________________________________________
+AliITSgeom::AliITSgeom(){
+////////////////////////////////////////////////////////////////////////
+// The default constructor for the AliITSgeom class. It, by default,
+// sets fNlayers to zero and zeros all pointers.
+////////////////////////////////////////////////////////////////////////
+ // Default constructor.
+ // Do not allocate anything zero everything
+ fNlayers = 0;
+ fNlad = 0;
+ fNdet = 0;
+ fg = 0;
+ fShape = 0;
+ return;
+}
+
+//_____________________________________________________________________
+AliITSgeom::~AliITSgeom(){
+////////////////////////////////////////////////////////////////////////
+// The destructor for the AliITSgeom class. If the arrays fNlad,
+// fNdet, or fg have had memory allocated to them, there pointer values
+// are non zero, then this memory space is freed and they are set
+// to zero. In addition, fNlayers is set to zero. The destruction of
+// TObjArray fShape is, by default, handled by the TObjArray destructor.
+////////////////////////////////////////////////////////////////////////
+ // Default destructor.
+ // if arrays exist delet them. Then set everything to zero.
+ if(fg!=0){
+ for(Int_t i=0;i<fNlayers;i++) delete[] fg[i];
+ delete[] fg;
+ } // end if fg!=0
+ if(fNlad!=0) delete[] fNlad;
+ if(fNdet!=0) delete[] fNdet;
+ fNlayers = 0;
+ fNlad = 0;
+ fNdet = 0;
+ fg = 0;
+ return;
+}
+
+//_____________________________________________________________________
+AliITSgeom::AliITSgeom(const char *filename){
+////////////////////////////////////////////////////////////////////////
+// The constructor for the AliITSgeom class. All of the data to fill
+// this structure is read in from the file given my the input filename.
+////////////////////////////////////////////////////////////////////////
+ FILE *pf;
+ Int_t i;
+ ITS_geom *g;
+ Int_t l,a,d;
+ Float_t x,y,z,o,p,q,r,s,t;
+ Double_t or,pr,qr,rr,sr,tr; // Radians
+ Double_t lr[9];
+ Double_t si; // sin(angle)
+ Double_t PI = TMath::Pi(), byPI = PI/180.;
+
+ pf = fopen(filename,"r");
+
+ fNlayers = 6; // set default number of ladders
+ fNlad = new Int_t[fNlayers];
+ fNdet = new Int_t[fNlayers];
+ // find the number of laders and detectors in this geometry.
+ for(i=0;i<fNlayers;i++){fNlad[i]=fNdet[i]=0;} // zero out arrays
+ for(;;){ // for ever loop
+ i = fscanf(pf,"%d %d %d %f %f %f %f %f %f %f %f %f",
+ &l,&a,&d,&x,&y,&z,&o,&p,&q,&r,&s,&t);
+ if(i==EOF) break;
+ if(l<1 || l>fNlayers) {
+ printf("error in file %s layer=%d min is 1 max is %d/n",
+ filename,l,fNlayers);
+ continue;
+ }// end if l
+ if(fNlad[l-1]<a) fNlad[l-1] = a;
+ if(fNdet[l-1]<d) fNdet[l-1] = d;
+ } // end for ever loop
+ // counted the number of laders and detectors now allocate space.
+ fg = new ITS_geom* [fNlayers];
+ for(i=0;i<fNlayers;i++){
+ fg[i] = 0;
+ l = fNlad[i]*fNdet[i];
+ fg[i] = new ITS_geom[l]; // allocate space for transforms
+ } // end for i
+
+ // Set up Shapes for a default configuration of 6 layers.
+ fShape = new TObjArray;
+ AddShape((TObject *) new AliITSgeomSPD()); // shape 0
+ AddShape((TObject *) new AliITSgeomSDD()); // shape 1
+ AddShape((TObject *) new AliITSgeomSPD()); // shape 2
+
+ // prepair to read in transforms
+ rewind(pf); // start over reading file
+ for(;;){ // for ever loop
+ i = fscanf(pf,"%d %d %d %f %f %f %f %f %f %f %f %f",
+ &l,&a,&d,&x,&y,&z,&o,&p,&q,&r,&s,&t);
+ if(i==EOF) break;
+ if(l<1 || l>fNlayers) {
+ printf("error in file %s layer=%d min is 1 max is %d/n",
+ filename,l,fNlayers);
+ continue;
+ }// end if l
+ l--; a--; d--; // shift layer, lader, and detector counters to zero base
+ i = d + a*fNdet[l]; // position of this detector
+ g = &(fg[l][i]);
+
+ or = byPI*o;
+ pr = byPI*p;
+ qr = byPI*q;
+ rr = byPI*r;
+ sr = byPI*s;
+ tr = byPI*t;
+
+ g->fx0 = x;
+ g->fy0 = y;
+ g->fz0 = z;
+ si = sin(or);if(o== 90.0) si = +1.0;
+ if(o==270.0) si = -1.0;
+ if(o== 0.0||o==180.) si = 0.0;
+ lr[0] = si * cos(pr);
+ lr[1] = si * sin(pr);
+ lr[2] = cos(or);if(o== 90.0||o==270.) lr[2] = 0.0;
+ if(o== 0.0) lr[2] = +1.0;
+ if(o==180.0) lr[2] = -1.0;
+ si = sin(qr);if(q== 90.0) si = +1.0;
+ if(q==270.0) si = -1.0;
+ if(q== 0.0||q==180.) si = 0.0;
+ lr[3] = si * cos(rr);
+ lr[4] = si * sin(rr);
+ lr[5] = cos(qr);if(q== 90.0||q==270.) lr[5] = 0.0;
+ if(q== 0.0) lr[5] = +1.0;
+ if(q==180.0) lr[5] = -1.0;
+ si = sin(sr);if(r== 90.0) si = +1.0;
+ if(r==270.0) si = -1.0;
+ if(r== 0.0||r==180.) si = 0.0;
+ lr[6] = si * cos(tr);
+ lr[7] = si * sin(tr);
+ lr[8] = cos(sr);if(r== 90.0||r==270.0) lr[8] = 0.0;
+ if(r== 0.0) lr[8] = +1.0;
+ if(r==180.0) lr[8] = -1.0;
+ // Normalize these elements
+ for(a=0;a<3;a++){// reuse float si and integers a and d.
+ si = 0.0;
+ for(d=0;d<3;d++) si += lr[3*a+d]*lr[3*a+d];
+ si = TMath::Sqrt(1./si);
+ for(d=0;d<3;d++) g->fr[3*a+d] = lr[3*a+d] = si*lr[3*a+d];
+ } // end for a
+ // get angles from matrix up to a phase of 180 degrees.
+ or = atan2(lr[7],lr[8]);if(or<0.0) or += 2.0*PI;
+ pr = asin(lr[2]); if(pr<0.0) pr += 2.0*PI;
+ qr = atan2(lr[3],lr[0]);if(qr<0.0) qr += 2.0*PI;
+ g->frx = or;
+ g->fry = pr;
+ g->frz = qr;
+ // l = layer-1 at this point.
+ if(l==0||l==1) g->fShapeIndex = 0; // SPD's
+ else if(l==2||l==3) g->fShapeIndex = 1; // SDD's
+ else if(l==4||l==5) g->fShapeIndex = 2; // SSD's
+ } // end for ever loop
+ fclose(pf);
+}
+
+//________________________________________________________________________
+AliITSgeom::AliITSgeom(AliITSgeom &source){
+////////////////////////////////////////////////////////////////////////
+// The copy constructor for the AliITSgeom class. It calls the
+// = operator function. See the = operator function for more details.
+////////////////////////////////////////////////////////////////////////
+ source = *this; // Just use the = operator for now.
+ return;
+}
+
+//________________________________________________________________________
+void AliITSgeom::operator=(AliITSgeom &source){
+////////////////////////////////////////////////////////////////////////
+// The = operator function for the AliITSgeom class. It makes an
+// independent copy of the class in such a way that any changes made
+// to the copied class will not affect the source class in any way.
+// This is required for many ITS alignment studies where the copied
+// class is then modified by introducing some misalignment.
+////////////////////////////////////////////////////////////////////////
+ Int_t i,j,k;
+
+ if(this == &source) return; // don't assign to ones self.
+
+ // if there is an old structure allocated delete it first.
+ if(fg != 0){
+ for(i=0;i<fNlayers;i++) delete[] fg[i];
+ delete[] fg;
+ } // end if fg != 0
+ if(fNlad != 0) delete[] fNlad;
+ if(fNdet != 0) delete[] fNdet;
+
+ fNlayers = source.fNlayers;
+ fNlad = new Int_t[fNlayers];
+ for(i=0;i<fNlayers;i++) fNlad[i] = source.fNlad[i];
+ fNdet = new Int_t[fNlayers];
+ for(i=0;i<fNlayers;i++) fNdet[i] = source.fNdet[i];
+ fShape = new TObjArray(*(source.fShape));//This does not make a proper copy.
+ fg = new ITS_geom* [fNlayers];
+ for(i=0;i<fNlayers;i++){
+ fg[i] = new ITS_geom[fNlad[i]*fNdet[i]];
+ for(j=0;j<(fNlad[i]*fNdet[i]);j++){
+ fg[i][j].fShapeIndex = source.fg[i][j].fShapeIndex;
+ fg[i][j].fx0 = source.fg[i][j].fx0;
+ fg[i][j].fy0 = source.fg[i][j].fy0;
+ fg[i][j].fz0 = source.fg[i][j].fz0;
+ fg[i][j].frx = source.fg[i][j].frx;
+ fg[i][j].fry = source.fg[i][j].fry;
+ fg[i][j].frz = source.fg[i][j].frz;
+ for(k=0;k<9;k++) fg[i][j].fr[k] = source.fg[i][j].fr[k];
+ } // end for j
+ } // end for i
+ return;
+}
+
+
+//________________________________________________________________________
+void AliITSgeom::GtoL(Int_t lay,Int_t lad,Int_t det,
+ const Float_t *g,Float_t *l){
+////////////////////////////////////////////////////////////////////////
+// The function that does the global ALICE Cartesian coordinate
+// to local active volume detector Cartesian coordinate transformation.
+// The local detector coordinate system is determined by the layer,
+// ladder, and detector numbers. The global coordinates are entered by
+// the three element Float_t array g and the local coordinate values
+// are returned by the three element Float_t array l. The order of the
+// three elements are g[0]=x, g[1]=y, and g[2]=z, similarly for l.
+////////////////////////////////////////////////////////////////////////
+ Double_t x,y,z;
+ ITS_geom *gl;
+
+ lay--; lad--; det--;
+ gl = &(fg[lay][fNdet[lay]*lad+det]);
+
+ x = g[0] - gl->fx0;
+ y = g[1] - gl->fy0;
+ z = g[2] - gl->fz0;
+ l[0] = gl->fr[0]*x + gl->fr[1]*y + gl->fr[2]*z;
+ l[1] = gl->fr[3]*x + gl->fr[4]*y + gl->fr[5]*z;
+ l[2] = gl->fr[6]*x + gl->fr[7]*y + gl->fr[8]*z;
+ return;
+}
+
+//________________________________________________________________________
+void AliITSgeom::GtoL(const Int_t *id,const Float_t *g,Float_t *l){
+////////////////////////////////////////////////////////////////////////
+// The function that does the local active volume detector Cartesian
+// coordinate to global ALICE Cartesian coordinate transformation.
+// The local detector coordinate system is determined by the layer,
+// ladder, and detector numbers. The local coordinates are entered by
+// the three element Float_t array l and the global coordinate values
+// are returned by the three element Float_t array g. The order of the
+// three elements are l[0]=x, l[1]=y, and l[2]=z, similarly for g.
+////////////////////////////////////////////////////////////////////////
+ Int_t lay,lad,det;
+ Double_t x,y,z;
+ ITS_geom *gl;
+
+ lay = id[0]; lad = id[1]; det = id[2];
+ lay--; lad--; det--;
+ gl = &(fg[lay][fNdet[lay]*lad+det]);
+
+ x = g[0] - gl->fx0;
+ y = g[1] - gl->fy0;
+ z = g[2] - gl->fz0;
+ l[0] = gl->fr[0]*x + gl->fr[1]*y + gl->fr[2]*z;
+ l[1] = gl->fr[3]*x + gl->fr[4]*y + gl->fr[5]*z;
+ l[2] = gl->fr[6]*x + gl->fr[7]*y + gl->fr[8]*z;
+ return;
+}
+//________________________________________________________________________
+void AliITSgeom::GtoL(Int_t index,const Float_t *g,Float_t *l){
+////////////////////////////////////////////////////////////////////////
+// The function that does the local active volume detector Cartesian
+// coordinate to global ALICE Cartesian coordinate transformation.
+// The local detector coordinate system is determined by the detector
+// index numbers (see GetModuleIndex and GetModuleID). The local
+// coordinates are entered by the three element Float_t array l and the
+// global coordinate values are returned by the three element Float_t array g.
+// The order of the three elements are l[0]=x, l[1]=y, and l[2]=z, similarly
+// for g.
+////////////////////////////////////////////////////////////////////////
+ Int_t lay,lad,det;
+ Double_t x,y,z;
+ ITS_geom *gl;
+
+ this->GetModuleId(index,lay,lad,det);
+ lay--; lad--; det--;
+ gl = &(fg[lay][fNdet[lay]*lad+det]);
+
+ x = g[0] - gl->fx0;
+ y = g[1] - gl->fy0;
+ z = g[2] - gl->fz0;
+ l[0] = gl->fr[0]*x + gl->fr[1]*y + gl->fr[2]*z;
+ l[1] = gl->fr[3]*x + gl->fr[4]*y + gl->fr[5]*z;
+ l[2] = gl->fr[6]*x + gl->fr[7]*y + gl->fr[8]*z;
+ return;
+}
+
+//________________________________________________________________________
+void AliITSgeom::LtoG(Int_t lay,Int_t lad,Int_t det,
+ const Float_t *l,Float_t *g){
+////////////////////////////////////////////////////////////////////////
+// The function that does the local active volume detector Cartesian
+// coordinate to global ALICE Cartesian coordinate transformation.
+// The local detector coordinate system is determined by the layer,
+// ladder, and detector numbers. The local coordinates are entered by
+// the three element Float_t array l and the global coordinate values
+// are returned by the three element Float_t array g. The order of the
+// three elements are l[0]=x, l[1]=y, and l[2]=z, similarly for g.
+////////////////////////////////////////////////////////////////////////
+ Double_t x,y,z;
+ ITS_geom *gl;
+
+ lay--; lad--; det--;
+ gl = &(fg[lay][fNdet[lay]*lad+det]);
+
+ x = gl->fr[0]*l[0] + gl->fr[3]*l[1] + gl->fr[6]*l[2];
+ y = gl->fr[1]*l[0] + gl->fr[4]*l[1] + gl->fr[7]*l[2];
+ z = gl->fr[2]*l[0] + gl->fr[5]*l[1] + gl->fr[8]*l[2];
+ g[0] = x + gl->fx0;
+ g[1] = y + gl->fy0;
+ g[2] = z + gl->fz0;
+ return;
+}
+
+//________________________________________________________________________
+void AliITSgeom::LtoG(const Int_t *id,const Float_t *l,Float_t *g){
+////////////////////////////////////////////////////////////////////////
+// The function that does the local active volume detector Cartesian
+// coordinate to global ALICE Cartesian coordinate transformation.
+// The local detector coordinate system is determined by the three
+// element array Id containing as it's three elements Id[0]=layer,
+// Id[1]=ladder, and Id[2]=detector numbers. The local coordinates
+// are entered by the three element Float_t array l and the global
+// coordinate values are returned by the three element Float_t array g.
+// The order of the three elements are l[0]=x, l[1]=y, and l[2]=z,
+// similarly for g.
+////////////////////////////////////////////////////////////////////////
+ Int_t lay,lad,det;
+ Double_t x,y,z;
+ ITS_geom *gl;
+
+ lay = id[0]; lad = id[1]; det = id[2];
+ lay--; lad--; det--;
+ gl = &(fg[lay][fNdet[lay]*lad+det]);
+
+ x = gl->fr[0]*l[0] + gl->fr[3]*l[1] + gl->fr[6]*l[2];
+ y = gl->fr[1]*l[0] + gl->fr[4]*l[1] + gl->fr[7]*l[2];
+ z = gl->fr[2]*l[0] + gl->fr[5]*l[1] + gl->fr[8]*l[2];
+ g[0] = x + gl->fx0;
+ g[1] = y + gl->fy0;
+ g[2] = z + gl->fz0;
+ return;
+}
+//________________________________________________________________________
+void AliITSgeom::LtoG(Int_t index,const Float_t *l,Float_t *g){
+////////////////////////////////////////////////////////////////////////
+// The function that does the local active volume detector Cartesian
+// coordinate to global ALICE Cartesian coordinate transformation.
+// The local detector coordinate system is determined by the detector
+// index number (see GetModuleIndex and GetModuleId). The local coordinates
+// are entered by the three element Float_t array l and the global
+// coordinate values are returned by the three element Float_t array g.
+// The order of the three elements are l[0]=x, l[1]=y, and l[2]=z,
+// similarly for g.
+////////////////////////////////////////////////////////////////////////
+ Int_t lay,lad,det;
+ Double_t x,y,z;
+ ITS_geom *gl;
+
+ this->GetModuleId(index,lay,lad,det);
+ lay--; lad--; det--;
+ gl = &(fg[lay][fNdet[lay]*lad+det]);
+
+ x = gl->fr[0]*l[0] + gl->fr[3]*l[1] + gl->fr[6]*l[2];
+ y = gl->fr[1]*l[0] + gl->fr[4]*l[1] + gl->fr[7]*l[2];
+ z = gl->fr[2]*l[0] + gl->fr[5]*l[1] + gl->fr[8]*l[2];
+ g[0] = x + gl->fx0;
+ g[1] = y + gl->fy0;
+ g[2] = z + gl->fz0;
+ return;
+}
+//________________________________________________________________________
+void AliITSgeom::GtoLMomentum(Int_t lay,Int_t lad,Int_t det,
+ const Float_t *g,Float_t *l){
+////////////////////////////////////////////////////////////////////////
+// The function that does the global ALICE Cartesian momentum
+// to local active volume detector Cartesian momentum transformation.
+// The local detector coordinate system is determined by the layer,
+// ladder, and detector numbers. The global momentums are entered by
+// the three element Float_t array g and the local momentums values
+// are returned by the three element Float_t array l. The order of the
+// three elements are g[0]=x, g[1]=y, and g[2]=z, similarly for l.
+////////////////////////////////////////////////////////////////////////
+ Double_t px,py,pz;
+ ITS_geom *gl;
+
+ lay--; lad--; det--;
+ gl = &(fg[lay][fNdet[lay]*lad+det]);
+
+ px = g[0];
+ py = g[1];
+ pz = g[2];
+ l[0] = gl->fr[0]*px + gl->fr[1]*py + gl->fr[2]*pz;
+ l[1] = gl->fr[3]*px + gl->fr[4]*py + gl->fr[5]*pz;
+ l[2] = gl->fr[6]*px + gl->fr[7]*py + gl->fr[8]*pz;
+ return;
+}
+//________________________________________________________________________
+void AliITSgeom::LtoGMomentum(Int_t lay,Int_t lad,Int_t det,
+ const Float_t *l,Float_t *g){
+////////////////////////////////////////////////////////////////////////
+// The function that does the local active volume detector Cartesian
+// momentum to global ALICE Cartesian momentum transformation.
+// The local detector momentum system is determined by the layer,
+// ladder, and detector numbers. The locall momentums are entered by
+// the three element Float_t array l and the global momentum values
+// are returned by the three element Float_t array g. The order of the
+// three elements are l[0]=x, l[1]=y, and l[2]=z, similarly for g.
+////////////////////////////////////////////////////////////////////////
+ Double_t px,py,pz;
+ ITS_geom *gl;
+
+ lay--; lad--; det--;
+ gl = &(fg[lay][fNdet[lay]*lad+det]);
+
+ px = gl->fr[0]*l[0] + gl->fr[3]*l[1] + gl->fr[6]*l[2];
+ py = gl->fr[1]*l[0] + gl->fr[4]*l[1] + gl->fr[7]*l[2];
+ pz = gl->fr[2]*l[0] + gl->fr[5]*l[1] + gl->fr[8]*l[2];
+ g[0] = px;
+ g[1] = py;
+ g[2] = pz;
+ return;
+}
+//___________________________________________________________________________
+Int_t AliITSgeom::GetModuleIndex(Int_t lay,Int_t lad,Int_t det){
+ Int_t i,j,k;
+
+ i = fNdet[lay-1] * (lad-1) + det - 1;
+ j = 0;
+ for(k=0;k<lay-1;k++) j += fNdet[k]*fNlad[k];
+ return (i+j);
+}
+//___________________________________________________________________________
+void AliITSgeom::GetModuleId(Int_t index,Int_t &lay,Int_t &lad,Int_t &det){
+ Int_t i,j,k;
+
+ j = 0;
+ for(k=0;k<fNlayers;k++){
+ j += fNdet[k]*fNlad[k];
+ if(index>j)break;
+ } // end for k
+ lay = k+1;
+ i = index -j + fNdet[k]*fNlad[k];
+ j = 0;
+ for(k=0;k<fNlad[lay-1];k++){
+ j += fNdet[k];
+ if(i>fNdet[k])break;
+ } // end for k
+ lad = k+1;
+ det = 1+i-fNdet[lay-1]*k;
+ return;
+}
+//___________________________________________________________________________
+void AliITSgeom::GlobalChange(Float_t *tran,Float_t *rot){
+////////////////////////////////////////////////////////////////////////
+// This function performs a Cartesian translation and rotation of
+// the full ITS from its default position by an amount determined by
+// the three element arrays dtranslation and drotation. If every element
+// of dtranslation and drotation are zero then there is no change made
+// the geometry. The change is global in that the exact same translation
+// and rotation is done to every detector element in the exact same way.
+// The units of the translation are those of the Monte Carlo, usually cm,
+// and those of the rotation are in radians. The elements of dtranslation
+// are dtranslation[0] = x, dtranslation[1] = y, and dtranslation[2] = z.
+// The elements of drotation are drotation[0] = rx, drotation[1] = ry, and
+// drotation[2] = rz. A change in x will move the hole ITS in the ALICE
+// global x direction, the same for a change in y. A change in z will
+// result in a translation of the ITS as a hole up or down the beam line.
+// A change in the angles will result in the inclination of the ITS with
+// respect to the beam line, except for an effective rotation about the
+// beam axis which will just rotate the ITS as a hole about the beam axis.
+////////////////////////////////////////////////////////////////////////
+ Int_t i,j,k,l;
+ Double_t rx,ry,rz;
+ Double_t sx,cx,sy,cy,sz,cz;
+ ITS_geom *gl;
+
+ for(i=0;i<fNlayers;i++){
+ for(j=0;j<fNlad[i];j++) for(k=0;k<fNdet[i];k++){
+ l = fNdet[i]*j+k; // resolved index
+ gl = &(fg[i][l]);
+ gl->fx0 += tran[0];
+ gl->fy0 += tran[1];
+ gl->fz0 += tran[2];
+ gl->frx += rot[0];
+ gl->fry += rot[1];
+ gl->frz += rot[2];
+ rx = gl->frx; ry = gl->fry; rz = gl->frz;
+ sx = sin(rx); cx = cos(rx);
+ sy = sin(ry); cy = cos(ry);
+ sz = sin(rz); cz = cos(rz);
+ gl->fr[0] = cz*cy;
+ gl->fr[1] = -cz*sy*sx - sz*cx;
+ gl->fr[2] = -cz*sy*cx + sz*sx;
+ gl->fr[3] = sz*cy;
+ gl->fr[4] = -sz*sy*sx + cz*cx;
+ gl->fr[5] = -sz*sy*cx - cz*sx;
+ gl->fr[6] = sy;
+ gl->fr[7] = cy*sx;
+ gl->fr[8] = cy*cx;
+ } // end for j,k
+ } // end for i
+ return;
+}
+
+//___________________________________________________________________________
+void AliITSgeom::GlobalCylindericalChange(Float_t *tran,Float_t *rot){
+////////////////////////////////////////////////////////////////////////
+// This function performs a cylindrical translation and rotation of
+// each ITS element by a fixed about in radius, rphi, and z from its
+// default position by an amount determined by the three element arrays
+// dtranslation and drotation. If every element of dtranslation and
+// drotation are zero then there is no change made the geometry. The
+// change is global in that the exact same distance change in translation
+// and rotation is done to every detector element in the exact same way.
+// The units of the translation are those of the Monte Carlo, usually cm,
+// and those of the rotation are in radians. The elements of dtranslation
+// are dtranslation[0] = r, dtranslation[1] = rphi, and dtranslation[2] = z.
+// The elements of drotation are drotation[0] = rx, drotation[1] = ry, and
+// drotation[2] = rz. A change in r will results in the increase of the
+// radius of each layer by the same about. A change in rphi will results in
+// the rotation of each layer by a different angle but by the same
+// circumferential distance. A change in z will result in a translation
+// of the ITS as a hole up or down the beam line. A change in the angles
+// will result in the inclination of the ITS with respect to the beam
+// line, except for an effective rotation about the beam axis which will
+// just rotate the ITS as a hole about the beam axis.
+////////////////////////////////////////////////////////////////////////
+ Int_t i,j,k,l;
+ Double_t rx,ry,rz,r,phi,rphi; // phi in radians
+ Double_t sx,cx,sy,cy,sz,cz,r0;
+ ITS_geom *gl;
+
+// printf("trans=%f %f %f rot=%f %f %f\n",tran[0],tran[1],tran[2],
+// rot[0],rot[1],rot[2]);
+ for(i=0;i<fNlayers;i++){
+ for(j=0;j<fNlad[i];j++) for(k=0;k<fNdet[i];k++){
+ l = fNdet[i]*j+k; // resolved index
+ gl = &(fg[i][l]);
+ r = r0= TMath::Hypot(gl->fy0,gl->fx0);
+ phi = atan2(gl->fy0,gl->fx0);
+ rphi = r0*phi;
+ r += tran[0];
+ rphi += tran[1];
+ phi = rphi/r0;
+ gl->fx0 = r*TMath::Cos(phi);
+ gl->fy0 = r*TMath::Sin(phi);
+ gl->fz0 += tran[2];
+ gl->frx += rot[0];
+ gl->fry += rot[1];
+ gl->frz += rot[2];
+ rx = gl->frx; ry = gl->fry; rz = gl->frz;
+ sx = sin(rx); cx = cos(rx);
+ sy = sin(ry); cy = cos(ry);
+ sz = sin(rz); cz = cos(rz);
+ gl->fr[0] = cz*cy;
+ gl->fr[1] = -cz*sy*sx - sz*cx;
+ gl->fr[2] = -cz*sy*cx + sz*sx;
+ gl->fr[3] = sz*cy;
+ gl->fr[4] = -sz*sy*sx + cz*cx;
+ gl->fr[5] = -sz*sy*cx - cz*sx;
+ gl->fr[6] = sy;
+ gl->fr[7] = cy*sx;
+ gl->fr[8] = cy*cx;
+ } // end for j,k
+ } // end for i
+ return;
+}
+
+//___________________________________________________________________________
+void AliITSgeom::RandomChange(Float_t *stran,Float_t *srot){
+////////////////////////////////////////////////////////////////////////
+// This function performs a Gaussian random displacement and/or
+// rotation about the present global position of each active
+// volume/detector of the ITS. The sigma of the random displacement
+// is determined by the three element array stranslation, for the
+// x y and z translations, and the three element array srotation,
+// for the three rotation about the axis x y and z.
+////////////////////////////////////////////////////////////////////////
+ Int_t i,j,k,l;
+ Double_t rx,ry,rz;
+ Double_t sx,cx,sy,cy,sz,cz;
+ TRandom ran;
+ ITS_geom *gl;
+
+ for(i=0;i<fNlayers;i++){
+ for(j=0;j<fNlad[i];j++) for(k=0;k<fNdet[i];k++){
+ l = fNdet[i]*j+k; // resolved index
+ gl = &(fg[i][l]);
+ gl->fx0 += ran.Gaus(0.0,stran[0]);
+ gl->fy0 += ran.Gaus(0.0,stran[1]);
+ gl->fz0 += ran.Gaus(0.0,stran[2]);
+ gl->frx += ran.Gaus(0.0, srot[0]);
+ gl->fry += ran.Gaus(0.0, srot[1]);
+ gl->frz += ran.Gaus(0.0, srot[2]);
+ rx = gl->frx; ry = gl->fry; rz = gl->frz;
+ sx = sin(rx); cx = cos(rx);
+ sy = sin(ry); cy = cos(ry);
+ sz = sin(rz); cz = cos(rz);
+ gl->fr[0] = cz*cy;
+ gl->fr[1] = -cz*sy*sx - sz*cx;
+ gl->fr[2] = -cz*sy*cx + sz*sx;
+ gl->fr[3] = sz*cy;
+ gl->fr[4] = -sz*sy*sx + cz*cx;
+ gl->fr[5] = -sz*sy*cx - cz*sx;
+ gl->fr[6] = sy;
+ gl->fr[7] = cy*sx;
+ gl->fr[8] = cy*cx;
+ } // end for j,k
+ } // end for i
+ return;
+}
+
+//___________________________________________________________________________
+void AliITSgeom::RandomCylindericalChange(Float_t *stran,Float_t *srot){
+////////////////////////////////////////////////////////////////////////
+// This function performs a Gaussian random displacement and/or
+// rotation about the present global position of each active
+// volume/detector of the ITS. The sigma of the random displacement
+// is determined by the three element array stranslation, for the
+// r rphi and z translations, and the three element array srotation,
+// for the three rotation about the axis x y and z. This random change
+// in detector position allow for the simulation of a random uncertainty
+// in the detector positions of the ITS.
+////////////////////////////////////////////////////////////////////////
+ Int_t i,j,k,l;
+ Double_t rx,ry,rz,r,phi,x,y; // phi in radians
+ Double_t sx,cx,sy,cy,sz,cz,r0;
+ TRandom ran;
+ ITS_geom *gl;
+
+// printf("trans=%f %f %f rot=%f %f %f\n",stran[0],stran[1],stran[2],
+// srot[0],srot[1],srot[2]);
+ for(i=0;i<fNlayers;i++){
+ for(j=0;j<fNlad[i];j++) for(k=0;k<fNdet[i];k++){
+ l = fNdet[i]*j+k; // resolved index
+ gl = &(fg[i][l]);
+ x = gl->fx0;
+ y = gl->fy0;
+ r = r0= TMath::Hypot(y,x);
+ phi = TMath::ATan2(y,x);
+// if(phi<0.0) phi += 2.0*TMath::Pi();
+ r += ran.Gaus(0.0,stran[0]);
+ phi += ran.Gaus(0.0,stran[1])/r0;
+// printf("fx0=%f fy0=%f rcos(phi)=%f rsin(phi)=%f\n",gl->fx0,gl->fy0,
+// r*TMath::Cos(phi),r*TMath::Sin(phi));
+ gl->fx0 = r*TMath::Cos(phi);
+ gl->fy0 = r*TMath::Sin(phi);
+// printf("r0=%f r=%f hypot=%f phi0=%f phi=%f ATan2=%f\n",
+// r0,r,TMath::Hypot(gl->fy0,gl->fx0),
+// phi0,phi,TMath::ATan2(gl->fy0,gl->fx0));
+ gl->fz0 += ran.Gaus(0.0,stran[2]);
+ gl->frx += ran.Gaus(0.0, srot[0]);
+ gl->fry += ran.Gaus(0.0, srot[1]);
+ gl->frz += ran.Gaus(0.0, srot[2]);
+ rx = gl->frx; ry = gl->fry; rz = gl->frz;
+ sx = sin(rx); cx = cos(rx);
+ sy = sin(ry); cy = cos(ry);
+ sz = sin(rz); cz = cos(rz);
+ gl->fr[0] = cz*cy;
+ gl->fr[1] = -cz*sy*sx - sz*cx;
+ gl->fr[2] = -cz*sy*cx + sz*sx;
+ gl->fr[3] = sz*cy;
+ gl->fr[4] = -sz*sy*sx + cz*cx;
+ gl->fr[5] = -sz*sy*cx - cz*sx;
+ gl->fr[6] = sy;
+ gl->fr[7] = cy*sx;
+ gl->fr[8] = cy*cx;
+ } // end for j,k
+ } // end for i
+ return;
+}
+
+//___________________________________________________________________________
+void AliITSgeom::SetByAngles(Int_t lay,Int_t lad,Int_t det,
+ Float_t rx,Float_t ry,Float_t rz){
+////////////////////////////////////////////////////////////////////////
+// This function computes a new rotation matrix based on the angles
+// rx, ry, and rz (in radians) for a give detector on the give ladder
+// in the give layer. A new
+// fg[layer-1][(fNlad[layer-1]*(ladder-1)+detector-1)].fr[] array is
+// computed.
+////////////////////////////////////////////////////////////////////////
+ ITS_geom *g;
+ Double_t sx,cx,sy,cy,sz,cz;
+
+ lay--; lad--; det--; // set to zero base now.
+ g = &(fg[lay][fNdet[lay]*lad+det]);
+
+ sx = sin(rx); cx = cos(rx);
+ sy = sin(ry); cy = cos(ry);
+ sz = sin(rz); cz = cos(rz);
+ g->frx = rx;
+ g->fry = ry;
+ g->frz = rz;
+ g->fr[0] = cz*cy;
+ g->fr[1] = -cz*sy*sx - sz*cx;
+ g->fr[2] = -cz*sy*cx + sz*sx;
+ g->fr[3] = sz*cy;
+ g->fr[4] = -sz*sy*sx + cz*cx;
+ g->fr[5] = -sz*sy*cx - cz*sx;
+ g->fr[6] = sy;
+ g->fr[7] = cy*sx;
+ g->fr[8] = cy*cx;
+ return;
+}
+
+//___________________________________________________________________________
+void AliITSgeom::GetRotMatrix(Int_t lay,Int_t lad,Int_t det,Float_t *mat){
+////////////////////////////////////////////////////////////////////////
+// Returns, in the Float_t array pointed to by mat, the full rotation
+// matrix for the give detector defined by layer, ladder, and detector.
+// It returns all nine elements of fr in the ITS_geom structure. See the
+// description of the ITS_geom structure for further details of this
+// rotation matrix.
+////////////////////////////////////////////////////////////////////////
+ Int_t i;
+ ITS_geom *g;
+
+ lay--; lad--; det--; // shift to base 0
+ g = &(fg[lay][fNdet[lay]*lad+det]);
+ for(i=0;i<9;i++) mat[i] = g->fr[i];
+ return;
+}
+
+//___________________________________________________________________________
+void AliITSgeom::PrintComparison(FILE *fp,AliITSgeom *other){
+////////////////////////////////////////////////////////////////////////
+// This function was primarily created for diagnostic reasons. It
+// print to a file pointed to by the file pointer fp the difference
+// between two AliITSgeom classes. The format of the file is basicly,
+// define d? to be the difference between the same element of the two
+// classes. For example dfrx = this->fg[i][j].frx - other->fg[i][j].frx.
+// if(at least one of dfx0, dfy0, dfz0,dfrx,dfry,dfrz are non zero) then print
+// layer ladder detector dfx0 dfy0 dfz0 dfrx dfry dfrz
+// if(at least one of the 9 elements of dfr[] are non zero) then print
+// layer ladder detector dfr[0] dfr[1] dfr[2]
+// dfr[3] dfr[4] dfr[5]
+// dfr[6] dfr[7] dfr[8]
+// Only non zero values are printed to save space. The differences are
+// typical written to a file because there are usually a lot of numbers
+// printed out and it is usually easier to read them in some nice editor
+// rather than zooming quickly past you on a screen. fprintf is used to
+// do the printing. The fShapeIndex difference is not printed at this time.
+////////////////////////////////////////////////////////////////////////
+ Int_t i,j,k,l;
+ Double_t xt,yt,zt,xo,yo,zo;
+ Double_t rxt,ryt,rzt,rxo,ryo,rzo; // phi in radians
+ ITS_geom *gt,*go;
+ Bool_t t;
+
+ for(i=0;i<this->fNlayers;i++){
+ for(j=0;j<this->fNlad[i];j++) for(k=0;k<this->fNdet[i];k++){
+ l = this->fNdet[i]*j+k; // resolved index
+ gt = &(this->fg[i][l]);
+ go = &(other->fg[i][l]);
+ xt = gt->fx0; yt = gt->fy0; zt = gt->fz0;
+ xo = go->fx0; yo = go->fy0; zo = go->fz0;
+ rxt = gt->frx; ryt = gt->fry; rzt = gt->frz;
+ rxo = go->frx; ryo = go->fry; rzo = go->frz;
+ if(!(xt==xo&&yt==yo&&zt==zo&&rxt==rxo&&ryt==ryo&&rzt==rzo))
+ fprintf(fp,"%1.1d %2.2d %2.2d dTrans=%f %f %f drot=%f %f %f\n",
+ i+1,j+1,k+1,xt-xo,yt-yo,zt-zo,rxt-rxo,ryt-ryo,rzt-rzo);
+ t = kFALSE;
+ for(i=0;i<9;i++) t = gt->fr[i] != go->fr[i];
+ if(t){
+ fprintf(fp,"%1.1d %2.2d %2.2d dfr= %e %e %e\n",i+1,j+1,k+1,
+ gt->fr[0]-go->fr[0],gt->fr[1]-go->fr[1],gt->fr[2]-go->fr[2]);
+ fprintf(fp," dfr= %e %e %e\n",
+ gt->fr[3]-go->fr[3],gt->fr[4]-go->fr[4],gt->fr[5]-go->fr[5]);
+ fprintf(fp," dfr= %e %e %e\n",
+ gt->fr[6]-go->fr[6],gt->fr[7]-go->fr[7],gt->fr[8]-go->fr[8]);
+ }
+ } // end for j,k
+ } // end for i
+ return;
+}
+
+//___________________________________________________________________________
+void AliITSgeom::PrintData(FILE *fp,Int_t lay,Int_t lad,Int_t det){
+////////////////////////////////////////////////////////////////////////
+// This function prints out the coordinate transformations for
+// the particular detector defined by layer, ladder, and detector
+// to the file pointed to by the File pointer fp. fprinf statements
+// are used to print out the numbers. The format is
+// layer ladder detector Trans= fx0 fy0 fz0 rot= frx fry frz Shape=fShapeIndex
+// dfr= fr[0] fr[1] fr[2]
+// dfr= fr[3] fr[4] fr[5]
+// dfr= fr[6] fr[7] fr[8]
+// By indicating which detector, some control over the information
+// is given to the user. The output it written to the file pointed
+// to by the file pointer fp. This can be set to stdout if you want.
+////////////////////////////////////////////////////////////////////////
+ Int_t i,j,k,l;
+ ITS_geom *gt;
+
+ i = lay-1;
+ j = lad-1;
+ k = det-1;
+ l = this->fNdet[i]*j+k; // resolved index
+ gt = &(this->fg[i][l]);
+ fprintf(fp,"%1.1d %2.2d %2.2d Trans=%f %f %f rot=%f %f %f Shape=%d\n",
+ i+1,j+1,k+1,gt->fx0,gt->fy0,gt->fz0,gt->frx,gt->fry,gt->frz,
+ gt->fShapeIndex);
+ fprintf(fp," dfr= %e %e %e\n",gt->fr[0],gt->fr[1],gt->fr[2]);
+ fprintf(fp," dfr= %e %e %e\n",gt->fr[3],gt->fr[4],gt->fr[5]);
+ fprintf(fp," dfr= %e %e %e\n",gt->fr[6],gt->fr[7],gt->fr[8]);
+ return;
+}
+//___________________________________________________________________________
+void AliITSgeom::Streamer(TBuffer &R__b){
+////////////////////////////////////////////////////////////////////////
+// The default Streamer function "written by ROOT" doesn't write out
+// the arrays referenced by pointers. Therefore, a specific Streamer function
+// has to be written. This function should not be modified but instead added
+// on to so that older versions can still be read. The proper handling of
+// the version dependent streamer function hasn't been written do to the lack
+// of finding an example at the time of writting.
+////////////////////////////////////////////////////////////////////////
+ // Stream an object of class AliITSgeom.
+ Int_t i,j,k;
+
+ if (R__b.IsReading()) {
+ Version_t R__v = R__b.ReadVersion(); if (R__v) { }
+ TObject::Streamer(R__b);
+ R__b >> fNlayers;
+ if(fNlad!=0) delete[] fNlad;
+ if(fNdet!=0) delete[] fNdet;
+ fNlad = new Int_t[fNlayers];
+ fNdet = new Int_t[fNlayers];
+ for(i=0;i<fNlayers;i++) R__b >> fNlad[i];
+ for(i=0;i<fNlayers;i++) R__b >> fNdet[i];
+ if(fg!=0){
+ for(i=0;i<fNlayers;i++) delete[] fg[i];
+ delete[] fg;
+ } // end if fg!=0
+ fg = new ITS_geom*[fNlayers];
+ for(i=0;i<fNlayers;i++){
+ fg[i] = new ITS_geom[fNlad[i]*fNdet[i]];
+ for(j=0;j<fNlad[i]*fNdet[i];j++){
+ R__b >> fg[i][j].fShapeIndex;
+ R__b >> fg[i][j].fx0;
+ R__b >> fg[i][j].fy0;
+ R__b >> fg[i][j].fz0;
+ R__b >> fg[i][j].frx;
+ R__b >> fg[i][j].fry;
+ R__b >> fg[i][j].frz;
+ for(k=0;k<9;k++) R__b >> fg[i][j].fr[k];
+ } // end for j
+ } // end for i
+ R__b >> fShape;
+ } else {
+ R__b.WriteVersion(AliITSgeom::IsA());
+ TObject::Streamer(R__b);
+ R__b << fNlayers;
+ for(i=0;i<fNlayers;i++) R__b << fNlad[i];
+ for(i=0;i<fNlayers;i++) R__b << fNdet[i];
+ for(i=0;i<fNlayers;i++) for(j=0;j<fNlad[i]*fNdet[i];j++){
+ R__b << fg[i][j].fShapeIndex;
+ R__b << fg[i][j].fx0;
+ R__b << fg[i][j].fy0;
+ R__b << fg[i][j].fz0;
+ R__b << fg[i][j].frx;
+ R__b << fg[i][j].fry;
+ R__b << fg[i][j].frz;
+ for(k=0;k<9;k++) R__b << fg[i][j].fr[k];
+ } // end for i,j
+ R__b << fShape;
+ }
+}
+
+//___________________________________________________________________________
+ofstream & AliITSgeom::PrintGeom(ofstream &R__b){
+////////////////////////////////////////////////////////////////////////
+// The default Streamer function "written by ROOT" doesn't write out
+// the arrays referenced by pointers. Therefore, a specific Streamer function
+// has to be written. This function should not be modified but instead added
+// on to so that older versions can still be read. The proper handling of
+// the version dependent streamer function hasn't been written do to the lack
+// of finding an example at the time of writting.
+////////////////////////////////////////////////////////////////////////
+ // Stream an object of class AliITSgeom.
+ Int_t i,j,k;
+
+ R__b.setf(ios::scientific);
+ R__b << fNlayers << " ";
+ for(i=0;i<fNlayers;i++) R__b << fNlad[i] << " ";
+ for(i=0;i<fNlayers;i++) R__b << fNdet[i] << "\n";
+ for(i=0;i<fNlayers;i++) for(j=0;j<fNlad[i]*fNdet[i];j++){
+ R__b <<setprecision(16) << fg[i][j].fShapeIndex << " ";
+ R__b <<setprecision(16) << fg[i][j].fx0 << " ";
+ R__b <<setprecision(16) << fg[i][j].fy0 << " ";
+ R__b <<setprecision(16) << fg[i][j].fz0 << " ";
+ R__b <<setprecision(16) << fg[i][j].frx << " ";
+ R__b <<setprecision(16) << fg[i][j].fry << " ";
+ R__b <<setprecision(16) << fg[i][j].frz << "\n";
+ for(k=0;k<9;k++) R__b <<setprecision(16) << fg[i][j].fr[k] << " ";
+ R__b << "\n";
+ } // end for i,j
+// R__b << fShape;
+ return R__b;
+}
+
+//___________________________________________________________________________
+ifstream & AliITSgeom::ReadGeom(ifstream &R__b){
+////////////////////////////////////////////////////////////////////////
+// The default Streamer function "written by ROOT" doesn't write out
+// the arrays referenced by pointers. Therefore, a specific Streamer function
+// has to be written. This function should not be modified but instead added
+// on to so that older versions can still be read. The proper handling of
+// the version dependent streamer function hasn't been written do to the lack
+// of finding an example at the time of writting.
+////////////////////////////////////////////////////////////////////////
+ // Stream an object of class AliITSgeom.
+ Int_t i,j,k;
+
+ R__b >> fNlayers;
+ if(fNlad!=0) delete[] fNlad;
+ if(fNdet!=0) delete[] fNdet;
+ fNlad = new Int_t[fNlayers];
+ fNdet = new Int_t[fNlayers];
+ for(i=0;i<fNlayers;i++) R__b >> fNlad[i];
+ for(i=0;i<fNlayers;i++) R__b >> fNdet[i];
+ if(fg!=0){
+ for(i=0;i<fNlayers;i++) delete[] fg[i];
+ delete[] fg;
+ } // end if fg!=0
+ fg = new ITS_geom*[fNlayers];
+ for(i=0;i<fNlayers;i++){
+ fg[i] = new ITS_geom[fNlad[i]*fNdet[i]];
+ for(j=0;j<fNlad[i]*fNdet[i];j++){
+ R__b >> fg[i][j].fShapeIndex;
+ R__b >> fg[i][j].fx0;
+ R__b >> fg[i][j].fy0;
+ R__b >> fg[i][j].fz0;
+ R__b >> fg[i][j].frx;
+ R__b >> fg[i][j].fry;
+ R__b >> fg[i][j].frz;
+ for(k=0;k<9;k++) R__b >> fg[i][j].fr[k];
+ } // end for j
+ } // end for i
+// R__b >> fShape;
+ return R__b;
+}
--- /dev/null
+#ifndef ITSGEOM_H
+#define ITSGEOM_H
+/////////////////////////////////////////////////////////////////////////
+// ITS geometry manipulation routines.
+// Created April 15 1999.
+// version: 0.0.0
+// By: Bjorn S. Nilsen
+//
+// A package of geometry routines to do transformations between
+// local, detector active area, and ALICE global coordinate system in such
+// a way as to allow for detector alignment studies and the like. All of
+// the information needed to do the coordinate transformation are kept in
+// a specialized structure for ease of implementation.
+/////////////////////////////////////////////////////////////////////////
+#include <fstream.h>
+#include "TObjArray.h"
+#include "AliITSgeomSPD.h"
+#include "AliITSgeomSDD.h"
+#include "AliITSgeomSSD.h"
+
+////////////////////////////////////////////////////////////////////////
+// The structure ITS_geom:
+// The structure ITS_geom has been defined to hold all of the
+// information necessary to do the coordinate transformations for one
+// detector between the ALICE Cartesian global and the detector local
+// coordinate systems. The rotations are implemented in the following
+// order, Rz*Ry*Rx*(Vglobal-Vtrans)=Vlocal (in matrix notation).
+// In addition it contains an index to the TObjArray containing all of
+// the information about the shape of the active detector volume, and
+// any other useful detector parameters. See the definition of *fShape
+// below and the classes AliITSgeomSPD, AliITSgeomSDD, and AliITSgeomSSD
+// for a full description. This structure is not available outside of
+// these routines.
+//
+// Int_t fShapeIndex
+// The index to the array of detector shape information. In this way
+// only an index is needed to be stored and not all of the shape
+// information. This saves much space since most, if not all, of the
+// detectors of a give type have the same shape information and are only
+// placed in a different spot in the ALICE/ITS detector.
+//
+// Float_t fx0,fy0,fz0
+// The Cartesian translation vector used to define part of the
+// coordinate transformation. The units of the translation are kept
+// in the Monte Carlo distance units, usually cm.
+//
+// Float_t frx,fry,frz
+// The three rotation angles that define the rotation matrix. The
+// angles are, frx the rotation about the x axis. fry the rotation about
+// the "new" or "rotated" y axis. frz the rotation about the "new" or
+// "rotated" z axis. These angles, although redundant with the rotation
+// matrix fr, are kept for speed. This allows for their retrieval without
+// having to compute them each and every time. The angles are kept in
+// radians
+//
+// Float_t fr[9]
+// The 3x3 rotation matrix defined by the angles frx, fry, and frz,
+// for the Global to Local transformation is
+// |fr[0] fr[1] fr[2]| | cos(frz) sin(frz) 0| | cos(fry) 0 sin(fry)|
+// fr=|fr[3] fr[4] fr[4]|=|-sin(frz) cos(frz) 0|*| 0 1 0 |
+// |fr[6] fr[7] fr[8]| | 0 0 1| |-sin(fry) 0 cos(fry)|
+//
+// |1 0 0 |
+// *|0 cos(frx) sin(frx)|
+// |0 -sin(frx) cos(frx)|
+//
+// Even though this information is redundant with the three rotation
+// angles, because this transformation matrix can be used so much it is
+// kept to speed things up a lot. The coordinate system used is Cartesian.
+////////////////////////////////////////////////////////////////////////
+
+struct ITS_geom {
+ Int_t fShapeIndex; // Shape index for this volume
+ Float_t fx0,fy0,fz0; // Translation vector
+ Float_t frx,fry,frz; // Rotation about axis, angle radians
+ Float_t fr[9]; // the rotation matrix
+};
+
+//_______________________________________________________________________
+
+class AliITSgeom : public TObject {
+////////////////////////////////////////////////////////////////////////
+//
+// version: 0
+// Written by Bjorn S. Nilsen
+//
+// Data Members:
+//
+// Int_t fNlayers
+// The number of ITS layers for this geometry. By default this
+// is 6, but can be modified by the creator function if there are
+// more layers defined.
+//
+// Int_t *fNlad
+// A pointer to an array fNlayers long containing the number of
+// ladders for each layer. This array is typically created and filled
+// by the AliITSgeom creator function.
+//
+// Int_t *fNdet
+// A pointer to an array fNlayers long containing the number of
+// active detector volumes for each ladder. This array is typically
+// created and filled by the AliITSgeom creator function.
+//
+// ITS_geom **fg
+// A pointer to an array of pointers pointing to the ITS_geom
+// structure containing the coordinate transformation information.
+// The ITS_geom structure corresponding to layer=lay, ladder=lad,
+// and detector=det is gotten by fg[lay-1][(fNlad[lay-1]*(lad-1)+det-1)].
+// In this way a lot of space is saved over trying to keep a three
+// dimensional array fNlayersXmax(fNlad)Xmax(fNdet), since the number
+// of detectors typically increases with layer number.
+//
+// TObjArray *fShape
+// A pointer to an array of TObjects containing the detailed shape
+// information for each type of detector used in the ITS. For example
+// I have created AliITSgeomSPD, AliITSgeomSDD, and AliITSgeomSSD as
+// example structures, derived from TObjects, to hold the detector
+// information. I would recommend that one element in each of these
+// structures, that which describes the shape of the active volume,
+// be one of the ROOT classes derived from TShape. In this way it would
+// be easy to have the display program display the correct active
+// ITS volumes. See the example classes AliITSgeomSPD, AliITSgeomSDD,
+// and AliITSgeomSSD for a more detailed example.
+//
+// Member Functions:
+//
+// AliITSgeom()
+// The default constructor for the AliITSgeom class. It, by default,
+// sets fNlayers to zero and zeros all pointers.
+//
+// AliITSgeom(const char *filename)
+// The constructor for the AliITSgeom class. All of the data to fill
+// this structure is read in from the file given my the input filename.
+//
+// AliITSgeom(AliITSgeom &source)
+// The copy constructor for the AliITSgeom class. It calls the
+// = operator function. See the = operator function for more details.
+//
+// void operator=(AliITSgeom &source)
+// The = operator function for the AliITSgeom class. It makes an
+// independent copy of the class in such a way that any changes made
+// to the copied class will not affect the source class in any way.
+// This is required for many ITS alignment studies where the copied
+// class is then modified by introducing some misalignment.
+//
+// ~AliITSgeom()
+// The destructor for the AliITSgeom class. If the arrays fNlad,
+// fNdet, or fg have had memory allocated to them, there pointer values
+// are non zero, then this memory space is freed and they are set
+// to zero. In addition, fNlayers is set to zero. The destruction of
+// TObjArray fShape is, by default, handled by the TObjArray destructor.
+//
+// Int_t GetNdetectors(Int_t layer)
+// This function returns the number of detectors/ladder for a give
+// layer. In particular it returns fNdet[layer-1].
+//
+// Int_t GetNladders(Int_t layer)
+// This function returns the number of ladders for a give layer. In
+// particular it returns fNlad[layer-1].
+//
+// Int_t GetNlayers()
+// This function returns the number of layers defined in the ITS
+// geometry. In particular it returns fNlayers.
+//
+// GetAngles(Int_t layer,Int_t ladder,Int_t detector,
+// Float_t &rx, Float_t &ry, Float_t &rz)
+// This function returns the rotation angles for a give detector on
+// a give ladder in a give layer in the three floating point variables
+// provided. rx = frx, fy = fry, rz = frz. The angles are in radians
+//
+// GetTrans(Int_t layer,Int_t ladder,Int_t detector,
+// Float_t &x, Float_t &y, Float_t &z)
+// This function returns the Cartesian translation for a give
+// detector on a give ladder in a give layer in the three floating
+// point variables provided. x = fx0, y = fy0, z = fz0. The units are
+// those of the Monte Carlo, generally cm.
+//
+// SetByAngles(Int_t layer,Int_t ladder,Int_t detector,
+// Float_t &rx, Float_t &ry, Float_t &rz)
+// This function computes a new rotation matrix based on the angles
+// rx, ry, and rz (in radians) for a give detector on the give ladder
+// in the give layer. A new
+// fg[layer-1][(fNlad[layer-1]*(ladder-1)+detector-1)].fr[] array is
+// computed.
+//
+// SetTrans(Int_t layer,Int_t ladder,Int_t detector,
+// Float_t x, Float_t y, Float_t z)
+// This function sets a new translation vector, given by the three
+// variables x, y, and z, for the Cartesian coordinate transformation
+// for the detector defined by layer, ladder and detector.
+//
+// GetRotMatrix(Int_t layer, Int_t ladder, Int_t detector, Float_t *mat)
+// Returns, in the Float_t array pointed to by mat, the full rotation
+// matrix for the give detector defined by layer, ladder, and detector.
+// It returns all nine elements of fr in the ITS_geom structure. See the
+// description of the ITS_geom structure for further details of this
+// rotation matrix.
+//
+// GtoL(Int_t layer, Int_t ladder, Int_t detector,
+// const Float_t *g, Float_t *l)
+// The function that does the global ALICE Cartesian coordinate
+// to local active volume detector Cartesian coordinate transformation.
+// The local detector coordinate system is determined by the layer,
+// ladder, and detector numbers. The global coordinates are entered by
+// the three element Float_t array g and the local coordinate values
+// are returned by the three element Float_t array l. The order of the
+// three elements are g[0]=x, g[1]=y, and g[2]=z, similarly for l.
+//
+// GtoL(const Int_t *Id, const Float_t *g, Float_t *l)
+// The function that does the global ALICE Cartesian coordinate
+// to local active volume detector Cartesian coordinate transformation.
+// The local detector coordinate system is determined by the three
+// element array Id containing as it's three elements Id[0]=layer,
+// Id[1]=ladder, and Id[2]=detector numbers. The global coordinates
+// are entered by the three element Float_t array g and the local
+// coordinate values are returned by the three element Float_t array l.
+// The order of the three elements are g[0]=x, g[1]=y, and g[2]=z,
+// similarly for l.
+//
+// LtoG(Int_t layer, Int_t ladder, Int_t detector,
+// const Float_t *l, Float_t *g)
+// The function that does the local active volume detector Cartesian
+// coordinate to global ALICE Cartesian coordinate transformation.
+// The local detector coordinate system is determined by the layer,
+// ladder, and detector numbers. The local coordinates are entered by
+// the three element Float_t array l and the global coordinate values
+// are returned by the three element Float_t array g. The order of the
+// three elements are l[0]=x, l[1]=y, and l[2]=z, similarly for g.
+//
+// LtoG(const Int_t *Id, const Float_t *l, Float_t *g)
+// The function that does the local active volume detector Cartesian
+// coordinate to global ALICE Cartesian coordinate transformation.
+// The local detector coordinate system is determined by the three
+// element array Id containing as it's three elements Id[0]=layer,
+// Id[1]=ladder, and Id[2]=detector numbers. The local coordinates
+// are entered by the three element Float_t array l and the global
+// coordinate values are returned by the three element Float_t array g.
+// The order of the three elements are l[0]=x, l[1]=y, and l[2]=z,
+// similarly for g.
+//
+// Int_t IsVersion()
+// This function returns the version number of this AliITSgeom
+// class.
+//
+// AddShape(TObject *shape)
+// This function adds one more shape element to the TObjArray
+// fShape. It is primarily used in the constructor functions of the
+// AliITSgeom class. The pointer *shape can be the pointer to any
+// class that is derived from TObject (this is true for nearly every
+// ROOT class). This does not appear to be working properly at this time.
+//
+// PrintComparison(FILE *fp, AliITSgeom *other)
+// This function was primarily created for diagnostic reasons. It
+// print to a file pointed to by the file pointer fp the difference
+// between two AliITSgeom classes. The format of the file is basicly,
+// define d? to be the difference between the same element of the two
+// classes. For example dfrx = this->fg[i][j].frx - other->fg[i][j].frx.
+// if(at least one of dfx0, dfy0, dfz0,dfrx,dfry,dfrz are non zero) then print
+// layer ladder detector dfx0 dfy0 dfz0 dfrx dfry dfrz
+// if(at least one of the 9 elements of dfr[] are non zero) then print
+// layer ladder detector dfr[0] dfr[1] dfr[2]
+// dfr[3] dfr[4] dfr[5]
+// dfr[6] dfr[7] dfr[8]
+// Only non zero values are printed to save space. The differences are
+// typical written to a file because there are usually a lot of numbers
+// printed out and it is usually easier to read them in some nice editor
+// rather than zooming quickly past you on a screen. fprintf is used to
+// do the printing. The fShapeIndex difference is not printed at this time.
+//
+// PrintData(FILE *fp, Int_t layer, Int_t ladder, Int_t detector)
+// This function prints out the coordinate transformations for
+// the particular detector defined by layer, ladder, and detector
+// to the file pointed to by the File pointer fp. fprinf statements
+// are used to print out the numbers. The format is
+// layer ladder detector Trans= fx0 fy0 fz0 rot= frx fry frz Shape=fShapeIndex
+// dfr= fr[0] fr[1] fr[2]
+// dfr= fr[3] fr[4] fr[5]
+// dfr= fr[6] fr[7] fr[8]
+// By indicating which detector, some control over the information
+// is given to the user. The output it written to the file pointed
+// to by the file pointer fp. This can be set to stdout if you want.
+//
+// Streamer(TBuffer &R__b)
+// The default Streamer function "written by ROOT" doesn't write out
+// the arrays referenced by pointers. Therefore, a specific Streamer function
+// has to be written. This function should not be modified but instead added
+// on to so that older versions can still be read. The proper handling of
+// the version dependent streamer function hasn't been written do to the lack
+// of finding an example at the time of writting.
+//
+//----------------------------------------------------------------------
+//
+// The following member functions are defined to modify an existing
+// AliITSgeom data structure. They were developed for the use in doing
+// alignment studies of the ITS.
+//
+// GlobalChange(Float_t *dtranslation, Float_t *drotation)
+// This function performs a Cartesian translation and rotation of
+// the full ITS from its default position by an amount determined by
+// the three element arrays dtranslation and drotation. If every element
+// of dtranslation and drotation are zero then there is no change made
+// the geometry. The change is global in that the exact same translation
+// and rotation is done to every detector element in the exact same way.
+// The units of the translation are those of the Monte Carlo, usually cm,
+// and those of the rotation are in radians. The elements of dtranslation
+// are dtranslation[0] = x, dtranslation[1] = y, and dtranslation[2] = z.
+// The elements of drotation are drotation[0] = rx, drotation[1] = ry, and
+// drotation[2] = rz. A change in x will move the hole ITS in the ALICE
+// global x direction, the same for a change in y. A change in z will
+// result in a translation of the ITS as a hole up or down the beam line.
+// A change in the angles will result in the inclination of the ITS with
+// respect to the beam line, except for an effective rotation about the
+// beam axis which will just rotate the ITS as a hole about the beam axis.
+//
+// GlobalCylindericalChange(Float_t *dtranslation, Float_t *drotation)
+// This function performs a cylindrical translation and rotation of
+// each ITS element by a fixed about in radius, rphi, and z from its
+// default position by an amount determined by the three element arrays
+// dtranslation and drotation. If every element of dtranslation and
+// drotation are zero then there is no change made the geometry. The
+// change is global in that the exact same distance change in translation
+// and rotation is done to every detector element in the exact same way.
+// The units of the translation are those of the Monte Carlo, usually cm,
+// and those of the rotation are in radians. The elements of dtranslation
+// are dtranslation[0] = r, dtranslation[1] = rphi, and dtranslation[2] = z.
+// The elements of drotation are drotation[0] = rx, drotation[1] = ry, and
+// drotation[2] = rz. A change in r will results in the increase of the
+// radius of each layer by the same about. A change in rphi will results in
+// the rotation of each layer by a different angle but by the same
+// circumferential distance. A change in z will result in a translation
+// of the ITS as a hole up or down the beam line. A change in the angles
+// will result in the inclination of the ITS with respect to the beam
+// line, except for an effective rotation about the beam axis which will
+// just rotate the ITS as a hole about the beam axis.
+//
+// RandomChange(Float_t *stranslation, Float_t *srotation)
+// This function performs a Gaussian random displacement and/or
+// rotation about the present global position of each active
+// volume/detector of the ITS. The sigma of the random displacement
+// is determined by the three element array stranslation, for the
+// x y and z translations, and the three element array srotation,
+// for the three rotation about the axis x y and z.
+//
+// RandomCylindericalChange(Float_t *stranslation, Float_t *srotation)
+// This function performs a Gaussian random displacement and/or
+// rotation about the present global position of each active
+// volume/detector of the ITS. The sigma of the random displacement
+// is determined by the three element array stranslation, for the
+// r rphi and z translations, and the three element array srotation,
+// for the three rotation about the axis x y and z. This random change
+// in detector position allow for the simulation of a random uncertainty
+// in the detector positions of the ITS.
+////////////////////////////////////////////////////////////////////////
+ private:
+ Int_t fNlayers; // The number of layers.
+ Int_t *fNlad; // Array of the number of ladders/layer(layer)
+ Int_t *fNdet; // Array of the number of detectors/ladder(layer)
+ ITS_geom **fg; // Structure of translation and rotation.
+ TObjArray *fShape; // Array of shapes and detector information.
+
+ public:
+ AliITSgeom(); // Default constructor
+ AliITSgeom(const char *filename); // Constructor
+ AliITSgeom(AliITSgeom &source); // Copy constructor
+ void operator=(AliITSgeom &source);// = operator
+ virtual ~AliITSgeom(); // Default destructor
+ // this is a dummy routine for now.
+ inline Int_t GetNdetectors(Int_t layer) {return fNdet[layer-1];}
+ inline Int_t GetNladders(Int_t layer) {return fNlad[layer-1];}
+ inline Int_t GetNlayers() {return fNlayers;}
+ inline void GetAngles(Int_t lay,Int_t lad,Int_t det,
+ Float_t &rx,Float_t &ry,Float_t &rz){
+ rx = fg[lay-1][fNdet[lay-1]*(lad-1)+det-1].frx;
+ ry = fg[lay-1][fNdet[lay-1]*(lad-1)+det-1].fry;
+ rz = fg[lay-1][fNdet[lay-1]*(lad-1)+det-1].frz;}
+ inline void GetTrans(Int_t lay,Int_t lad,Int_t det,
+ Float_t &x,Float_t &y,Float_t &z){
+ x = fg[lay-1][fNdet[lay-1]*(lad-1)+det-1].fx0;
+ y = fg[lay-1][fNdet[lay-1]*(lad-1)+det-1].fy0;
+ z = fg[lay-1][fNdet[lay-1]*(lad-1)+det-1].fz0;}
+ void SetByAngles(Int_t lay,Int_t lad,Int_t det,
+ Float_t rx,Float_t ry,Float_t rz);
+ inline void SetTrans(Int_t lay,Int_t lad,Int_t det,
+ Float_t x,Float_t y,Float_t z){
+ fg[lay-1][fNdet[lay-1]*(lad-1)+det-1].fx0 = x;
+ fg[lay-1][fNdet[lay-1]*(lad-1)+det-1].fy0 = y;
+ fg[lay-1][fNdet[lay-1]*(lad-1)+det-1].fz0 = z;}
+ void GetRotMatrix(Int_t lay,Int_t lad,Int_t det,Float_t *mat);
+ void GtoL(Int_t lay,Int_t lad,Int_t det,const Float_t *g,Float_t *l);
+ void GtoL(const Int_t *id,const Float_t *g,Float_t *l);
+ void GtoL(const Int_t index,const Float_t *g,Float_t *l);
+ void GtoLMomentum(Int_t lay,Int_t lad,Int_t det,const Float_t *g,Float_t *l);
+ void LtoG(Int_t lay,Int_t lad,Int_t det,const Float_t *l,Float_t *g);
+ void LtoG(const Int_t *id,const Float_t *l,Float_t *g);
+ void LtoG(const Int_t index,const Float_t *l,Float_t *g);
+ void LtoGMomentum(Int_t lay,Int_t lad,Int_t det,const Float_t *l,Float_t *g);
+ Int_t GetModuleIndex(Int_t lay,Int_t lad,Int_t det);
+ void GetModuleId(Int_t index,Int_t &lay,Int_t &lad,Int_t &det);
+ void GlobalChange(Float_t *tran,Float_t *rot);
+ void GlobalCylindericalChange(Float_t *tran,Float_t *rot);
+ void RandomChange(Float_t *stran,Float_t *srot);
+ void RandomCylindericalChange(Float_t *stran,Float_t *srot);
+ void PrintComparison(FILE *fp,AliITSgeom *other);
+ void PrintData(FILE *fp,Int_t lay,Int_t lad,Int_t det);
+ ofstream &PrintGeom(ofstream &out);
+ ifstream &ReadGeom(ifstream &in);
+ virtual Int_t IsVersion() const {return 0;}
+ inline void AddShape(TObject *shp){fShape->AddLast(shp);}
+
+ ClassDef(AliITSgeom,1)
+};
+
+#endif
--- /dev/null
+#include "AliITSgeomSDD.h"
+
+ClassImp(AliITSgeomSDD)
+AliITSgeomSDD::AliITSgeomSDD(){
+ //
+ // default constructor
+ //
+ fShapeSDD = new TBRIK("ActiveSDD","Active volume of SDD","SDD SI CHIP",
+ 3.0E-2/2.,7.25/2.,7.53/2.);
+}
--- /dev/null
+#ifndef ITSgeomSDD_H
+#define ITSgeomSDD_H
+
+#include "TShape.h"
+#include "TBRIK.h"
+
+class AliITSgeomSDD: public TObject {
+ private:
+ // define shape of active area using ROOT shapes so that they can
+ // be easly plotted. Inputs to TBRIK are
+ // Shape name (what ever that is)
+ // Shape title (what ever that means)
+ // name of material (something I took from ITSgeometry.tme file
+ // dx => 1/2 thickness of wafer's active volume (cm)
+ // dy => 1/2 r*phi size of active volume (cm)
+ // dz => 1/2 size of active volume (cm)
+ TBRIK *fShapeSDD;
+ // Other infomation like.
+ // Int_t fNAnodes; // count
+ // Float_t fAnodePitch; // cm
+ // Float_t fAnodeWidth; // cm
+ // or what other or different information that is needed.
+ public:
+ AliITSgeomSDD();
+ virtual ~AliITSgeomSDD(){};
+ inline TBRIK *GetShape(){return fShapeSDD;}
+
+ ClassDef(AliITSgeomSDD,1)
+};
+#endif
--- /dev/null
+#include "AliITSgeomSPD.h"
+
+ClassImp(AliITSgeomSPD)
+AliITSgeomSPD::AliITSgeomSPD(){
+ //
+ // default constructor
+ //
+ fShapeSPD = new TBRIK("ActiveSPD","Active volume of SPD","SPD SI CHIP",
+ 2.5E-2/2.0,1.38/2.0,8.2/2.0);
+}
--- /dev/null
+#ifndef ITSgeomSPD_H
+#define ITSgeomSPD_H
+
+#include "TShape.h"
+#include "TBRIK.h"
+
+class AliITSgeomSPD: public TObject {
+ private:
+ // define shape of active area using ROOT shapes so that they can
+ // be easly plotted. Inputs to TBRIK are
+ // Shape name (what ever that is)
+ // Shape title (what ever that means)
+ // name of material (something I took from ITSgeometry.tme file
+ // dx => 1/2 thickness of wafer's active volume (cm)
+ // dy => 1/2 r*phi size of active volume (cm)
+ // dz => 1/2 size of active volume (cm)
+ TBRIK *fShapeSPD;
+ // Other infomation like.
+ // Float_t fPitchZ; // cm
+ // Float_t fPitchY; // cm
+ // Float_t fCellZ; // cm
+ // Float_t fCellY; // cm
+ // or what other or different information that is needed.
+ public:
+ AliITSgeomSPD();
+ virtual ~AliITSgeomSPD(){};
+ inline TBRIK *GetShape(){return fShapeSPD;}
+
+ ClassDef(AliITSgeomSPD,1)
+};
+#endif
--- /dev/null
+#include "AliITSgeomSSD.h"
+
+ClassImp(AliITSgeomSSD)
+AliITSgeomSSD::AliITSgeomSSD(){
+ //
+ // default constructor
+ //
+ fShapeSSD = new TBRIK("ActiveSSD","Active volume of SSD","SI",
+ 3.0E-2/2.,1.73/2.,4.0/2.);
+}
--- /dev/null
+#ifndef ITSgeomSSD_H
+#define ITSgeomSSD_H
+
+#include "TShape.h"
+#include "TBRIK.h"
+
+class AliITSgeomSSD : public TObject {
+
+ private:
+ // define shape of active area using ROOT shapes so that they can
+ // be easly plotted. Inputs to TBRIK are
+ // Shape name (what ever that is)
+ // Shape title (what ever that means)
+ // name of material (something I took from ITSgeometry.tme file
+ // dx => 1/2 thickness of wafer's active volume (cm)
+ // dy => 1/2 r*phi size of active volume (cm)
+ // dz => 1/2 size of active volume (cm)
+ TBRIK *fShapeSSD;
+ // Other infomation like.
+ // Float_t fTopPitch; // cm
+ // Float_t fTopWidth; // cm
+ // Float_t fTopLength; // cm
+ // Float_t fTopAngle; // cm
+ // Float_t fBottomPitch; // cm
+ // Float_t fBottomWidth; // cm
+ // Float_t fBottomLength; // cm
+ // Float_t fBottomAngle; // cm
+ // or what other or different information that is needed.
+ public:
+ AliITSgeomSSD();
+ virtual ~AliITSgeomSSD() {};
+ inline TBRIK *GetShape(){return fShapeSSD;}
+
+ ClassDef(AliITSgeomSSD,1)
+};
+#endif
--- /dev/null
+
+#include <TMath.h>
+#include <TRandom.h>
+#include <TVector.h>
+#include <TGeometry.h>
+#include <TNode.h>
+#include <TTUBE.h>
+
+#include "AliITSgeom.h"
+#include "AliITS.h"
+#include "AliITShit.h"
+#include "AliRun.h"
+
+
+ClassImp(AliITShit)
+////////////////////////////////////////////////////////////////////////
+// Version: 0
+// Written by Rene Brun, Federico Carminati, and Roberto Barbera
+//
+// Version: 1
+// Modified and documented by Bjorn S. Nilsen
+// July 11 1999
+//
+// AliITShit is the hit class for the ITS. Hits are the information
+// that comes from a Monte Carlo at each step as a particle mass through
+// sensitive detector elements as particles are transported through a
+// detector.
+//
+//Begin_Html
+/*
+<img src="figures/AliITShit_Class_Diagram.gif">
+</pre>
+<br clear=left>
+<font size=+2 color=red>
+<p>This show the relasionships between the ITS hit class and the rest of Aliroot.
+</font>
+<pre>
+*/
+//End_Html
+//_____________________________________________________________________________
+AliITShit::AliITShit(Int_t shunt, Int_t track, Int_t *vol, Float_t *hits):
+ AliHit(shunt, track){
+ //
+ // Create ITS hit
+ // The creator of the AliITShit class. The variables shunt and
+ // track are passed to the creator of the AliHit class. See the AliHit
+ // class for a full description. the integer array *vol contains, in order,
+ // fLayer = vol[0], fDet = vol[1], fLadder = vol[2], fStatus = vol[3].
+ // The array *hits contains, in order, fX = hits[0], fY = hits[1],
+ // fZ = hits[2], fPx = hits[3], fPy = hits[4], fPz = hits[5],
+ // fDestep = hits[6], and fTof = hits[7].
+ //
+ fLayer = vol[0]; // Layer number
+ fLadder = vol[2]; // Ladder number
+ fDet = vol[1]; // Detector number
+ fStatus = vol[3]; // Track status flags
+ fX = hits[0]; // Track X position
+ fY = hits[1]; // Track Y position
+ fZ = hits[2]; // Track Z position
+ fPx = hits[3]; // Track X Momentum
+ fPy = hits[4]; // Track Y Momentum
+ fPz = hits[5]; // Track Z Momentum
+ fDestep = hits[6]; // Track dE/dx for this step
+ fTof = hits[7]; // Track Time of Flight for this step
+}
+
+void AliITShit::GetPositionL(Float_t &x,Float_t &y,Float_t &z){
+ AliITSgeom *gm = ((AliITS*)gAlice->GetDetector("ITS"))->GetITSgeom();
+ Float_t g[3],l[3];
+
+ g[0] = fX;
+ g[1] = fY;
+ g[2] = fZ;
+ gm->GtoL(fLayer,fLadder,fDet,g,l);
+ x = l[0];
+ y = l[1];
+ z = l[2];
+ return;
+}
+
+void AliITShit::GetPositionL(Float_t &x,Float_t &y,Float_t &z,Float_t &tof){
+ AliITSgeom *gm = ((AliITS*)gAlice->GetDetector("ITS"))->GetITSgeom();
+ Float_t g[3],l[3];
+
+ g[0] = fX;
+ g[1] = fY;
+ g[2] = fZ;
+ gm->GtoL(fLayer,fLadder,fDet,g,l);
+ x = l[0];
+ y = l[1];
+ z = l[2];
+ tof = fTof;
+ return;
+}
+
+Float_t AliITShit::GetXL(){
+ AliITSgeom *gm = ((AliITS*)gAlice->GetDetector("ITS"))->GetITSgeom();
+ Float_t g[3],l[3];
+
+ g[0] = fX;
+ g[1] = fY;
+ g[2] = fZ;
+ gm->GtoL(fLayer,fLadder,fDet,g,l);
+ return l[0];
+}
+
+Float_t AliITShit::GetYL(){
+ AliITSgeom *gm = ((AliITS*)gAlice->GetDetector("ITS"))->GetITSgeom();
+ Float_t g[3],l[3];
+
+ g[0] = fX;
+ g[1] = fY;
+ g[2] = fZ;
+ gm->GtoL(fLayer,fLadder,fDet,g,l);
+ return l[1];
+}
+
+Float_t AliITShit::GetZL(){
+ AliITSgeom *gm = ((AliITS*)gAlice->GetDetector("ITS"))->GetITSgeom();
+ Float_t g[3],l[3];
+
+ g[0] = fX;
+ g[1] = fY;
+ g[2] = fZ;
+ gm->GtoL(fLayer,fLadder,fDet,g,l);
+ return l[2];
+}
+
+void AliITShit::GetMomentumL(Float_t &px,Float_t &py,Float_t &pz){
+ AliITSgeom *gm = ((AliITS*)gAlice->GetDetector("ITS"))->GetITSgeom();
+ Float_t g[3],l[3];
+
+ g[0] = fPx;
+ g[1] = fPy;
+ g[2] = fPz;
+ gm->GtoLMomentum(fLayer,fLadder,fDet,g,l);
+ px = l[0];
+ py = l[1];
+ pz = l[2];
+ return;
+}
--- /dev/null
+#ifndef ITSHIT_H
+#define ITSHIT_H
+
+#include "AliDetector.h"
+#include "AliHit.h"
+#include "AliDigit.h"
+#include "AliITSgeom.h"
+
+
+class AliITShit : public AliHit {
+////////////////////////////////////////////////////////////////////////
+// Version: 0
+// Written by Rene Brun, Federico Carminati, and Roberto Barbera
+//
+// Version: 1
+// Modified and documented by Bjorn S. Nilsen
+// July 11 1999
+//
+// AliITShit is the hit class for the ITS. Hits are the information
+// that comes from a Monte Carlo at each step as a particle mass through
+// sensitive detector elements as particles are transported through a
+// detector.
+//
+// Data members:
+//
+// Int_t fTrack
+// See AliHit for a full description. The track number of the track
+// that made this hit.
+//
+// Float_t fX
+// See AliHit for a full description. The global x position of the
+// hit (in the standard units of the Monte Carlo).
+//
+// Float_t fY
+// See AliHit for a full description. The global y position of the
+// hit (in the standard units of the Monte Carlo).
+//
+// Float_t fZ
+// See AliHit for a full description. The global z position of the
+// hit (in the standard units of the Monte Carlo).
+//
+// Int_t fStatus
+// The track status flag. This flag indicates the track status
+// at the time of creating this hit. It is made up of the following 8
+// status bits from highest order to lowest order bits
+// 0 : IsTrackAlive(): IsTrackStop():IsTrackDisappeared():
+// IsTrackOut():IsTrackExiting():IsTrackEntering():IsTrackInside() .
+// See AliMC for a description of these functions. If the function is
+// true then the bit is set to one, otherwise it is zero.
+//
+// Int_t fLayer
+// The layer number of the detector that contains this hit. See
+// AliITSgeom and AliITSv? for a description of the geometry.
+//
+// Int_t fLadder
+// The ladder number of the detector that contains this hit. See
+// AliITSgeom and AliITSv? for a description of the geometry.
+//
+// Int_t fDet
+// The detector number of the detector that contains this hit. See
+// AliITSgeom and AliITSv? for a description of the geometry.
+//
+// Float_t fPx
+// The x momentum, in global coordinates, of the particle that
+// "created" the hit at the time and position of the hit. The units
+// are those determined by the Monte Carlo.
+//
+// Float_t fPy
+// The y momentum, in global coordinates, of the particle that
+// "created" the hit at the time and position of the hit. The units
+// are those determined by the Monte Carlo.
+//
+// Float_t fPz
+// The z momentum, in global coordinates, of the particle that
+// "created" the hit at the time and position of the hit. The units
+// are those determined by the Monte Carlo.
+//
+// Float_t fDestep
+// The energy lost by the particle during the step ending in this
+// hit. The units are those determined by the Monte Carlo.
+//
+// Float_t fTof
+// The time of flight associated with the particle ending in this
+// hit. The time is typically measured from the point of creation of the
+// original particle (if this particle is a daughter). The units
+// are those determined by the Monte Carlo.
+//
+//
+// Member functions:
+//
+// AliITShit()
+// The default creator of the AliITShit class.
+//
+// AliITShit(Int_t shunt, Int_t track, Int_t *vol, Float_t *hits)
+// The creator of the AliITShit class. The variables shunt and
+// track are passed to the creator of the AliHit class. See the AliHit
+// class for a full description. the integer array *vol contains, in order,
+// fLayer = vol[0], fDet = vol[1], fLadder = vol[2], fStatus = vol[3].
+// The array *hits contains, in order, fX = hits[0], fY = hits[1],
+// fZ = hits[2], fPx = hits[3], fPy = hits[4], fPz = hits[5],
+// fDestep = hits[6], and fTof = hits[7].
+//
+// ~AliITShit()
+// The default destructor of the AliITShit class.
+//
+// int GetTrack()
+// See AliHit for a full description. Returns the track number fTrack
+// for this hit.
+//
+// SetTrack(int track)
+// See AliHit for a full description. Sets the track number fTrack
+// for this hit.
+//
+// Int_t GetTrackStatus()
+// Returns the value of the track status flag fStatus. This flag
+// indicates the track status at the time of creating this hit. It is
+// made up of the following 8 status bits from highest order to lowest
+// order bits
+// 0 : IsTrackAlive(): IsTrackStop():IsTrackDisappeared():
+// IsTrackOut():IsTrackExiting():IsTrackEntering():IsTrackInside() .
+// See AliMC for a description of these functions. If the function is
+// true then the bit is set to one, otherwise it is zero.
+//
+// Int_t GetLayer()
+// Returns the layer number, fLayer, for this hit.
+//
+// Int_t GetLadder()
+// Returns the ladder number, fLadder, for this hit.
+//
+// Int_t GetDetector()
+// Returns the detector number, fDet, for this hit.
+//
+// GetDetectorID(Int_t &layer, Int_t &ladder, Int_t &detector)
+// Returns the layer, ladder, and detector numbers, fLayer fLadder fDet,
+// in one call.
+//
+// Float_t GetIonization()
+// Returns the energy lost, fDestep, by the particle creating this hit,
+// in the units defined by the Monte Carlo.
+//
+// GetPoositionG(Float_t &x, Float_t &y, Float_t &z)
+// Returns the global position, fX fY fZ, of this hit, in the units
+// define by the Monte Carlo.
+//
+// Float_t GetTOF()
+// Returns the time of flight, fTof, of this hit, in the units defined
+// by the Monte Carlo.
+//
+// GetPositionG(Float_t &x, Float_t &y, Float_t &z, Float_t &tof)
+// Returns the global position and time of flight, fX fY fZ fTof, of
+// this hit, in the units define by the Monte Carlo.
+//
+// GetPositioonP(Float_t &px, Float_t &py, Float_t &pz)
+// Returns the global momentum, fPx fPy fPz, of the particle that made
+// this hit, in the units define by the Monte Carlo.
+////////////////////////////////////////////////////////////////////////
+ // public; // defined in AliHit
+ // Int_t fTrack // defined in AliHit
+ // Float_t fX; // defined in AliHit
+ // Float_t fY; // defined in AliHit
+ // Float_t fZ; // defined in AliHit
+
+ public:
+//private:
+ Int_t fStatus; // Track Status
+ Int_t fLayer; // Layer number
+ Int_t fLadder; // Ladder number
+ Int_t fDet; // Detector number
+ Float_t fPx; // PX of particle at the point of the hit
+ Float_t fPy; // PY of particle at the point of the hit
+ Float_t fPz; // PZ of particle at the point of the hit
+ Float_t fDestep; // Energy deposited in the current step
+ Float_t fTof; // Time of flight at the point of the hit
+
+ public:
+ AliITShit() {}
+ AliITShit(Int_t shunt, Int_t track, Int_t *vol, Float_t *hits);
+ virtual ~AliITShit() {}
+ // Get Hit information functions.
+ // inline virtual int GetTrack(){return fTrack;} // define in AliHit
+ // inline virtual void SetTrack(int track){fTrack=track;) // AliHit
+ inline virtual Int_t GetTrackStatus() {return fStatus;}
+ inline virtual Int_t GetLayer() {return fLayer;}
+ inline virtual Int_t GetLadder() {return fLadder;}
+ inline virtual Int_t GetDetector() {return fDet;}
+ inline virtual void GetDetectorID(Int_t &layer,Int_t &ladder,
+ Int_t &detector)
+ {layer=fLayer;ladder=fLadder;detector=fDet;return;};
+ inline virtual Float_t GetIonization() {return fDestep;}
+ //
+ inline virtual void GetPositionG(Float_t &x,Float_t &y,Float_t &z)
+ {x=fX;y=fY;z=fZ;return;};
+ inline virtual Float_t GetTOF() {return fTof;}
+ inline virtual void GetPositionG(Float_t &x,Float_t &y,Float_t &z,
+ Float_t &tof)
+ {x=fX;y=fY;z=fZ,tof=fTof;return;};
+ inline virtual Float_t GetXG(){return fX;}
+ inline virtual Float_t GetYG(){return fY;}
+ inline virtual Float_t GetZG(){return fZ;}
+ virtual void GetPositionL(Float_t &x,Float_t &y,Float_t &z);
+ virtual void GetPositionL(Float_t &x,Float_t &y,Float_t &z,
+ Float_t &tof);
+ virtual Float_t GetXL();
+ virtual Float_t GetYL();
+ virtual Float_t GetZL();
+ // Get Monti Carlo information about hit.
+ inline virtual void GetMomentumG(Float_t &px,Float_t &py,Float_t &pz)
+ {px=fPx;py=fPy;pz=fPz;return;};
+ virtual void GetMomentumL(Float_t &px,Float_t &py,Float_t &pz);
+ ClassDef(AliITShit,1) //Hits object for set:ITS
+};
+
+#endif
--- /dev/null
+#include "AliITSmodule.h"
+#include "AliRun.h"
+
+ClassImp(AliITSmodule)
+
+//_______________________________________________________________________
+//
+// Impementation of class AliITSmodule
+//
+// created by: A. Bouchm, W. Peryt, S. Radomski, P. Skowronski
+// R. Barbers, B. Batyunia, B. S. Nilsen
+// ver 1.0 CERN 16.09.1999
+//_______________________________________________________________________
+//
+
+//________________________________________________________________________
+//
+// Constructors and deconstructor
+//________________________________________________________________________
+//
+
+
+AliITSmodule::AliITSmodule() {
+
+ fIndex = 0;
+ fHitsM = new TObjArray();
+ fNhitsM = 0;
+ fITS = (AliITS*)(gAlice->GetDetector("ITS"));
+}
+
+
+//_________________________________________________________________________
+
+AliITSmodule::AliITSmodule(Int_t index) {
+
+ fIndex = index;
+ fHitsM = new TObjArray();
+ fNhitsM = 0;
+ fITS = (AliITS*)(gAlice->GetDetector("ITS"));
+}
+
+
+//__________________________________________________________________________
+
+AliITSmodule::~AliITSmodule() {
+ if(fHitsM) delete fHitsM;
+ fNhitsM = 0;
+}
+
+//_________________________________________________________________________
+//
+// Hits menagement
+//__________________________________________________________________________
+
+
+Int_t AliITSmodule::AddHit(AliITShit* hit ) {
+ fHitsM->AddLast(hit);
+ fNhitsM = fHitsM->GetEntriesFast();
+ return fNhitsM;
+}
+
+//___________________________________________________________________________
+void AliITSmodule::Streamer(TBuffer &R__b){
+ // Stream an object of class AliITSmodule.
+
+ return;
+// This class is not to be written out to any file.
+// if (R__b.IsReading()) {
+// Version_t R__v = R__b.ReadVersion(); if (R__v) { }
+// TObject::Streamer(R__b);
+// R__b >> fITS;
+// R__b >> fIndex;
+// R__b >> fHitsM;
+// R__b >> fNhitsM;
+// R__b >> fIDigits;
+// R__b >> fNdigits;
+// R__b >> fIPoints;
+// R__b >> fNpoints;
+// } else {
+// R__b.WriteVersion(AliITSmodule::IsA());
+// TObject::Streamer(R__b);
+// R__b << fITS;
+// R__b << fIndex;
+// R__b << fHitsM;
+// R__b << fNhitsM;
+// R__b << fIDigits;
+// R__b << fNdigits;
+// R__b << fIPoints;
+// R__b << fNpoints;
+// }
+}
+//______________________________________________________________________
--- /dev/null
+#ifndef ALIITSMODULE_H
+#define ALIITSMODULE_H
+
+//#include "AliITSpoint.h"
+#include "AliITS.h"
+#include "AliITSdigit.h"
+#include "AliITShit.h"
+#include "TObjArray.h"
+#include "TArray.h"
+
+
+//________________________________________________________________
+//
+// Class AliITSmodule
+// is a superclass for AliITSmoduleSSD, SPD and SDD.
+// The main function of modules is to simulate DIGITS from
+// GEANT HITS and produce POINTS from DIGITS
+// It also make fast simulation without use of DIGITS
+//
+// created by: A.Boucham, W.Peryt, S.Radomski, P.Skowronski
+// R.Barbera, B. Batynia, B. Nilsen
+// ver. 1.0 CERN, 16.09.1999
+//
+//________________________________________________________________
+//
+
+
+class AliITSmodule : public TObject {
+
+public:
+
+ //________________________________________________________________
+ //
+ // Constructors and deconstructor
+ //________________________________________________________________
+ //
+
+ AliITSmodule(); // default constructor
+ AliITSmodule(Int_t index); // index in TObjectArray in ITS object
+
+ virtual ~AliITSmodule() ;
+
+ //________________________________________________________________
+ //
+ // Position menagenent
+ //________________________________________________________________
+ //
+
+ inline Int_t GetIndex() { return fIndex;}
+ //inline Int_t GetLayer() { return fLayer;}
+ //inline Int_t GetLadder() { return fLadder;}
+ //inline Int_t GetDet() { return fDet;}
+
+
+ //________________________________________________________________
+ //
+ // Hits menagement
+ //________________________________________________________________
+ //
+
+ inline Int_t GetNhits() { return fNhitsM;}
+ // returns number of hits in this module
+
+ inline TObjArray *GetHits() { return fHitsM; }
+ // returns pointer to array (TClonesArray) of pointers to hits
+
+ Int_t AddHit(AliITShit *hit);
+ // Adds pointer of hit belonging to this module
+ // and returns number of hits in this module
+
+ //________________________________________________________________
+ //
+ // Full Simulation
+ //________________________________________________________________
+ //
+
+ virtual void HitToDigit() {};
+ // this functon is virtual, becouse each type of a detector
+ // make simulation in its own specific methods
+
+ //________________________________________________________________
+ //
+ // Reconstruction
+ //________________________________________________________________
+ //
+
+ virtual void DigitToPoint() {};
+ // this functon is virtual, becouse each type of a detector
+ // make reconstruction in its own specific methods
+ // classes DIGIT and POINT are specyfic to detector type
+
+ //________________________________________________________________
+ //
+ // Fast Simulation
+ //________________________________________________________________
+ //
+
+ virtual void HitToPoint() {};
+ // this functon is virtual, becouse each type of a detector
+ // make fast simulation in its own specific methods
+ // this simulation do not use DIGITS
+
+
+protected:
+
+ //________________________________________________________________
+ //
+ // Data members
+ //________________________________________________________________
+ //
+
+ AliDetector *fITS; // Pointer to ITS detector
+ Int_t fIndex; // Index of this module in ITSmodules TObjectArray
+
+ TObjArray *fHitsM; // Pointer to list of hits on this module
+ Int_t fNhitsM; // Number of hits
+
+ TArrayI *fIdigits; // Indexes of DIGITS belonging to this module
+ // in array in ITS
+ Int_t fNdigits; // Number of DIGITS
+
+ TArrayI *fIpoints; // Indexes of POINTS belonging to this module
+ // in array in ITS
+ Int_t fNpoints; // Number of POINTS
+
+public:
+
+ //________________________________________________________________
+ //
+ // ROOT compatibility
+ //________________________________________________________________
+ //
+ ClassDef(AliITSmodule,1)
+};
+
+#endif
--- /dev/null
+
+#include "AliITSmoduleSDD.h"
+
+ClassImp(AliITSmoduleSDD)
+
+//____________________________________________________________________
+//
+// Constructor and descructor
+//____________________________________________________________________
+//
+
+AliITSmoduleSDD::AliITSmoduleSDD() {};
+
+AliITSmoduleSDD::AliITSmoduleSDD(Int_t index) {};
+
+AliITSmoduleSDD::~AliITSmoduleSDD() {};
--- /dev/null
+#ifndef ALIITSMODLUESDD_H
+#define ALIITSMODLUESDD_H
+
+
+#include "AliITS.h"
+#include "AliITSmodule.h"
+
+
+
+//____________________________________________________________________
+//
+// Class AliITSmoduleSDD
+// describes one SDD module
+// The main function of modules is to simulate DIGITS from
+// GEANT HITS and produce POINTS from DIGITS
+//
+// ver. 0.0 CERN, 17.09.1999
+//
+//___________________________________________________________________
+//
+
+
+
+class AliITSmoduleSDD: public AliITSmodule {
+
+
+public:
+
+ //________________________________________________________________
+ //
+ // Constructors and deconstructor
+ //________________________________________________________________
+ //
+
+ AliITSmoduleSDD();
+ AliITSmoduleSDD(Int_t index);
+ ~AliITSmoduleSDD();
+
+ //________________________________________________________________
+ //
+ // Data process methods
+ //________________________________________________________________
+ //
+
+ void HitToDigit() {}; // Not impemented yet
+ void DigitToPoint() {}; // Not impemented yet
+ void HitToPoint() {}; // Not impemented yet
+
+
+
+protected:
+
+public:
+ ClassDef(AliITSmoduleSDD, 1)
+};
+
+#endif
--- /dev/null
+
+#include "AliITSmoduleSPD.h"
+
+ClassImp(AliITSmoduleSPD)
+
+//____________________________________________________________________
+//
+// Constructor and descructor
+//____________________________________________________________________
+//
+
+AliITSmoduleSPD::AliITSmoduleSPD() {};
+
+AliITSmoduleSPD::AliITSmoduleSPD(Int_t index) {};
+
+AliITSmoduleSPD::~AliITSmoduleSPD() {};
+
--- /dev/null
+#ifndef ALIITSMODLUESPD_H
+#define ALIITSMODLUESPD_H
+
+
+#include "AliITS.h"
+#include "AliITSmodule.h"
+
+
+
+//____________________________________________________________________
+//
+// Class AliITSmoduleSPD
+// describes one SPD module
+// The main function of modules is to simulate DIGITS from
+// GEANT HITS and produce POINTS from DIGITS
+//
+// ver. 0.0 CERN, 17.09.1999
+//
+//___________________________________________________________________
+//
+
+
+
+class AliITSmoduleSPD: public AliITSmodule {
+
+
+public:
+
+ //________________________________________________________________
+ //
+ // Constructors and deconstructor
+ //________________________________________________________________
+ //
+
+ AliITSmoduleSPD();
+ AliITSmoduleSPD(Int_t index);
+ ~AliITSmoduleSPD();
+
+ //________________________________________________________________
+ //
+ // Data process methods
+ //________________________________________________________________
+ //
+
+ void HitToDigit() {}; // Not impemented yet
+ void DigitToPoint() {}; // Not impemented yet
+ void HitToPoint() {}; // Not impemented yet
+
+
+
+protected:
+
+public:
+ ClassDef(AliITSmoduleSPD, 1)
+};
+
+#endif
--- /dev/null
+
+#include "AliITSmoduleSSD.h"
+
+
+ClassImp(AliITSmoduleSSD)
+
+//____________________________________________________________________
+//
+// Constructor
+//____________________________________________________________________
+//
+
+
+AliITSmoduleSSD::AliITSmoduleSSD() {
+
+
+ //Invalid Strips parameters
+
+ fInvalidP = new TArrayS(0);
+ fInvalidN = new TArrayS(0);
+
+ fNInvalidP = 0;
+ fNInvalidN = 0;
+
+
+ //DCS parameters
+
+ fGainP = 83;
+ fGainN = 83;
+ fSNRatioP = 600;
+ fSNRatioP = 500;
+
+ fCouplingPR = 0.021;
+ fCouplingPL = 0.026;
+ fCouplingNR = 0.013;
+ fCouplingNL = 0.010;
+
+}
+
+AliITSmoduleSSD::AliITSmoduleSSD(Int_t index) {
+
+ fIndex = index;
+
+ //Invalid Strips parameters
+
+ fInvalidP = new TArrayS(0);
+ fInvalidN = new TArrayS(0);
+
+ fNInvalidP = 0;
+ fNInvalidN = 0;
+
+
+ //DCS parameters
+
+ fGainP = 83;
+ fGainN = 83;
+ fSNRatioP = 600;
+ fSNRatioP = 500;
+
+ fCouplingPR = 0.021;
+ fCouplingPL = 0.026;
+ fCouplingNR = 0.013;
+ fCouplingNL = 0.010;
+}
+
+AliITSmoduleSSD::~AliITSmoduleSSD() {
+
+ if (!fInvalidP) delete fInvalidP;
+ if (!fInvalidN) delete fInvalidN;
+}
+
+
+//____________________________________________________________________
+//
+// Inalid strips menagement
+//____________________________________________________________________
+//
+
+
+
+void AliITSmoduleSSD::SetInvalidP(Int_t strip, Bool_t b) {
+
+ Bool_t already = kFALSE;
+ Int_t i;
+
+ for (i=0; i<fNInvalidP; i++) {
+ if ((*fInvalidP)[i] == strip) {
+ already = kTRUE;
+ break;
+ }
+ }
+
+ if (!already && b) {
+ (*fInvalidP)[fNInvalidP++] = strip;
+ }
+}
+
+void AliITSmoduleSSD::SetInvalidMC(Float_t m, Float_t s) {
+
+ fNInvalid = m;
+ fISigma = s;
+ SetInvalidMC();
+}
+
+void AliITSmoduleSSD::SetInvalidMC() {
+
+ Int_t m = (Int_t)gRandom->Gaus(fNInvalid, fISigma);
+
+ for(int i=0; i<m; i++) {
+ SetInvalidP((Int_t)(gRandom->Rndm()*kNStrips), kTRUE);
+ }
+
+}
+
+Bool_t AliITSmoduleSSD::IsValidP(Int_t n) {
+
+ for(Int_t i=0; i<fNInvalidP; i++)
+ if ((*fInvalidP)[i] == n) return kFALSE;
+ return kTRUE;
+}
+
+Bool_t AliITSmoduleSSD::IsValidN(Int_t n) {
+
+ for(Int_t i=0; i<fNInvalidN; i++)
+ if ((*fInvalidN)[i] == n) return kFALSE;
+ return kTRUE;
+}
+
+
+//____________________________________________________________________
+//
+// Add digit
+//____________________________________________________________________
+//
+
+/*********************************************************************
+*
+* AddDigits
+* sets paramerers: layer, ladder detector
+* scan tracks wich produced this digit
+* creates new SSD DIGTS
+* call ITS to add digit to its Array
+* set index frm ITS in its own array
+*
+* S.Radomski 17.09.1999
+*
+*********************************************************************/
+
+void AliITSmoduleSSD::AddDigit(Int_t strNo, Int_t s, Bool_t p) {
+
+ Int_t tracks[3];
+ Int_t digits[4];
+ AliITSdigit *t = (AliITSdigit*) (new AliITSdigitSSD(tracks, digits,
+ strNo, s, p));
+
+ fIdigits->AddAt(((AliITS *)fITS)->AddDigit(t), fNdigits++);
+}
+
+
+//____________________________________________________________________
+//
+// Hits to digits
+//____________________________________________________________________
+//
+
+
+
+void AliITSmoduleSSD::HitToDigit() {
+
+ Int_t i; //for iteration
+ fP = new TArrayI(768);
+ fN = new TArrayI(768);
+
+ fPtrack1 = new TArrayI(768);
+ fPtrack2 = new TArrayI(768);
+ fPtrack3 = new TArrayI(768);
+
+ fNtrack1 = new TArrayI(768);
+ fNtrack2 = new TArrayI(768);
+ fNtrack3 = new TArrayI(768);
+
+ for(i=0; i<kNStrips; i++) {
+ (*fN)[i] = 0;
+ (*fP)[i] = 0;
+ } // end for i
+
+ for(i=0; i<fNhitsM; i++) HitToDigit(i);
+
+ ApplyCoupling();
+ ApplyNoise();
+
+ for(i=0; i<fNInvalidP; i++) (*fP)[(*fInvalidP)[i]] = -20;
+ for(i=0; i<fNInvalidN; i++) (*fN)[(*fInvalidN)[i]] = -20;
+
+ for(i=0; i<kNStrips; i++)
+ if ((*fP)[i]>kTresholdP) AddDigit(i+1, (*fP)[i], kTRUE);
+
+ for(i=0; i<kNStrips; i++)
+ if ((*fN)[i]>kTresholdN) AddDigit(i+1, (*fN)[i], kFALSE);
+
+ delete fN;
+ delete fP;
+
+ delete fPtrack1;
+ delete fPtrack2;
+ delete fPtrack3;
+
+ delete fPtrack1;
+ delete fPtrack2;
+ delete fPtrack3;
+
+}
+
+
+
+void AliITSmoduleSSD::HitToDigit(Int_t hitNo) {
+
+ Int_t stripP, stripN, i;
+ Float_t dsP, dsN;
+ Float_t sP, sN;
+ Float_t EP, EN;
+ AliITShit *hit = (AliITShit*)((*fHitsM)[hitNo]);
+ Float_t dZ = kZ/kSteps*1000, l;
+
+ if(hit->GetIonization()==0.0) return;
+
+ Float_t x = hit->GetXG();
+ Float_t y = hit->GetYG();
+
+ Float_t dx = 0.0; //TMath::Tan(hit->fTheta)*kZ/kSteps;
+ Float_t dy = 0.0; //TMath::Tan(hit->fPhi)*kZ/kSteps;
+ l = sqrt(dZ*dZ + dx*dx *1000000);
+
+ x -= (kSteps/2 -1) * dx;
+ y -= (kSteps/2 -1) * dy;
+
+ for (i=1; i<kSteps; i++) {
+
+ stripP = GetStripP(x, y);
+ dsP = Get2StripP(x, y);
+
+ stripN = GetStripN(x, y);
+ dsN = Get2StripN(x, y);
+
+ EP = gRandom->Landau(fGainP*l, l*10);
+ EN = gRandom->Landau(fGainN*l, l*10);
+
+ sP = kSigmaP * sqrt(i);
+ sN = kSigmaN * sqrt(kSteps-i);
+
+ sP = (i<3 && dsP>0.3 && dsP<0.7)? 0.02 : sP;
+ sN = (i>7 && dsN>0.3 && dsN<0.7)? 0.02 : sN;
+
+ sP = (i==3 && dsP>0.4 && dsP<0.6)? 0.015 : sP;
+ sN = (i==7 && dsN>0.4 && dsN<0.6)? 0.015 : sN;
+
+
+ (*fP)[stripP-1]+=(Int_t)(EP*(F(-0.5-dsP,sP)-F(-1.5-dsP,sP)));
+ (*fP)[stripP] +=(Int_t)(EP*(F(0.5-dsP,sP)-F(-0.5-dsP,sP)));
+ (*fP)[stripP+1]+=(Int_t)(EP*(F(1.5-dsP,sP)-F(0.5-dsP,sP)));
+ (*fP)[stripP+2]+=(Int_t)(EP*(F(2.5-dsP,sP)-F(1.5-dsP,sP)));
+
+ (*fN)[stripN-1]+=(Int_t)(EN*(F(-0.5-dsN,sN)-F(-1.5-dsN,sN)));
+ (*fN)[stripN] +=(Int_t)(EN*(F(0.5-dsN,sN)-F(-0.5-dsN,sN)));
+ (*fN)[stripN+1]+=(Int_t)(EN*(F(1.5-dsN,sN)-F(0.5-dsN,sN)));
+ (*fN)[stripN+2]+=(Int_t)(EN*(F(2.5-dsN,sN)-F(1.5-dsN,sN)));
+
+ x += dx;
+ y += dy;
+ }
+}
+
+
+//____________________________________________________________________
+//
+// Private Methods for Simulation
+//____________________________________________________________________
+//
+
+
+
+void AliITSmoduleSSD::ApplyNoise() {
+
+ for(Int_t i = 0; i<kNStrips; i++) {
+ (*fP)[i] += (Int_t)gRandom->Gaus(0,fSNRatioP);
+ (*fN)[i] += (Int_t)gRandom->Gaus(0,fSNRatioN);
+ }
+}
+
+void AliITSmoduleSSD::ApplyCoupling() {
+
+ for(Int_t i = 1; i<kNStrips-1; i++) {
+ (*fP)[i] += (Int_t)((*fP)[i-1]*fCouplingPL + (*fP)[i+1]*fCouplingPR);
+ (*fN)[i] += (Int_t)((*fN)[i-1]*fCouplingNL + (*fN)[i+1]*fCouplingNR);
+ }
+}
+
+
+//____________________________________________________________________
+//
+// Private methods for geometry
+//____________________________________________________________________
+//
+
+
+
+Int_t AliITSmoduleSSD::GetStripP(Float_t x, Float_t y) {
+
+ Float_t X = x - y*kTan;
+ Int_t strip = (Int_t)(X/kPitch);
+ strip = (strip<0)? -1: strip;
+ strip = (strip>kNStrips)? -1: strip;
+ return strip;
+}
+
+Int_t AliITSmoduleSSD::GetStripN(Float_t x, Float_t y) {
+
+ Float_t X = x - kTan*(kY - y);
+ Int_t strip = (Int_t)(X/kPitch);
+ strip = (strip<0)? -1: strip;
+ strip = (strip>kNStrips)? -1: strip;
+ return strip;
+
+}
+
+Float_t AliITSmoduleSSD::Get2StripP(Float_t x, Float_t y) {
+
+ Int_t n = GetStripP(x,y);
+ return (x - y*kTan) / kPitch - n;
+}
+
+Float_t AliITSmoduleSSD::Get2StripN(Float_t x, Float_t y) {
+
+ Int_t n = GetStripN(x,y);
+ return (x - kTan*(kY - y)) / kPitch - n;
+}
+
+
+Bool_t AliITSmoduleSSD::GetCrossing (Float_t &P, Float_t &N) {
+
+ P *= kPitch;
+ N *= kPitch;
+
+ P = (kY * kTan + N + P)/2.0; // x coordinate
+ N = kY - (P-N)/kTan; // y coordinate
+
+ if (N<0 || N>kY) return kFALSE;
+ if (P<0 || P>kX) return kFALSE;
+ return kTRUE;
+}
+
+//____________________________________________________________________
+
+
+
--- /dev/null
+#ifndef ALIITSMODLUESSD_H
+#define ALIITSMODLUESSD_H
+
+#include "TObject.h"
+#include "TArrayS.h"
+#include "TClonesArray.h"
+#include "TRandom.h"
+//#include "AliConst.h"
+#include "TMath.h"
+
+#include "AliITSdigitSSD.h"
+#include "AliITS.h"
+#include "AliITSmodule.h"
+
+
+
+//____________________________________________________________________
+//
+// Class AliITSmoduleSSD
+// describes one SSD module
+// The main function of modules is to simulate DIGITS from
+// GEANT HITS and produce POINTS from DIGITS
+//
+// This class keep track of Detector Control System parameters
+// of one SSD module: invalid (dead) strips, gain, capacitive
+// coupling.
+//
+// In this release it make only simulation, and is not completly
+// tuned - up. Simulation will be improved after tests of SSD
+// modules on SPS. Improved simulation and reconstruction will
+// appear in next releas.
+//
+// created by: A.Boucham, W.Peryt, S.Radomski, P.Skowronski
+// ver. 1.0 CERN, 16.09.1999
+//
+//___________________________________________________________________
+//
+
+
+
+class AliITSmoduleSSD: public AliITSmodule {
+
+
+public:
+
+ //________________________________________________________________
+ //
+ // Constructors and deconstructor
+ //________________________________________________________________
+ //
+
+ AliITSmoduleSSD();
+ AliITSmoduleSSD(Int_t index);
+ ~AliITSmoduleSSD();
+
+ //________________________________________________________________
+ //
+ // Data process methods
+ //________________________________________________________________
+ //
+
+ void AddDigit(Int_t, Int_t, Bool_t);
+ void HitToDigit(); // Process all hits in module
+ void HitToDigit(Int_t); // Proces one hit
+ void DigitToPoint() {}; // Not impemented yet
+ void HitToPoint() {}; // Not impemented y
+
+ //________________________________________________________________
+ //
+ //Invalid strips menagement methods
+ //________________________________________________________________
+ //
+
+ // Parameters for invalid strips MonteCarlo
+// void SetInvalidParam(Float_t mean, Float_t sigma);
+// void GetInvalParam(Float_t &mean, Float_t &sigma);
+
+ // Methods for creating invalid strips
+ void SetInvalidMC(Float_t mean, Float_t sigma);
+ void SetInvalidMC();
+
+ // Testing if strip is valid
+ Bool_t IsValidN(Int_t strip); //True if strip work properly
+ Bool_t IsValidP(Int_t strip);
+// TArrayI GetInvalidP(); //Array of invalid strips
+// TArrayI GetInvalidN();
+// Int_t GetNInvalidP(); //Number of invalid srtips
+// Int_t GrtNInvalidN();
+
+ // Creating invalid strips
+ void SetInvalidP(Int_t strip, Bool_t side); //Set invalid if true
+// void SetInvalidN(Int_t strip, Bool_t side);
+
+
+protected:
+
+ //________________________________________________________________
+ //
+ //Private methods for geometry
+ //________________________________________________________________
+ //
+
+ Int_t GetStripN(Float_t x, Float_t z); // Nearest strip number P-side
+ Int_t GetStripP(Float_t x, Float_t z); // Nearest strip number N-side
+
+ Float_t Get2StripN(Float_t, Float_t); // Ditance do the nearest strip P
+ Float_t Get2StripP(Float_t, Float_t); // Ditance do the nearest strip N
+
+ Bool_t GetCrossing(Float_t&, Float_t&); //x, y of strips crossing
+
+ //________________________________________________________________
+ //
+ //Private methods for simulation
+ //________________________________________________________________
+ //
+
+ void ApplyNoise();
+ void ApplyCoupling();
+
+ Float_t F(Float_t x, Float_t s) {return (TMath::Erf(x*kPitch/s)+1) /2;}
+
+ // Proceding part should be in SSDgeo ----->
+
+ //Technical parameters of detector
+ static const Float_t kStereo = 0.0175; //Stereo Angle 17.5 mrad
+ static const Float_t kTan = 0.0175;
+ static const Int_t kNStrips = 768; //Number of strips on each side
+ static const Float_t kPitch = 0.095; //Distance strip - strip (mm)
+ static const Float_t kX = 72.96; //X size (mm)
+ static const Float_t kY = 0.3; //Y size (mm)
+ static const Float_t kZ = 40; //Thickness (mm)
+
+ // <------------------------------
+
+ //______________________________________________________________
+ //
+ // Parameters for simulation
+ //______________________________________________________________
+
+ static const Float_t kSigmaP = 0.003; //Gaussian sigm
+ static const Float_t kSigmaN = 0.002;
+ static const Int_t kSteps = 10; //Number of steps
+ static const Int_t kTresholdP = 1500;
+ static const Int_t kTresholdN = 2500;
+
+ //________________________________________________________________
+ //
+ // DCS Parameters
+ //________________________________________________________________
+ //
+
+ Float_t fSNRatioP; //Signal - Noise Ratio P-side
+ Float_t fSNRatioN; //Signal - Noise RatioNP-side
+
+ Float_t fGainP; //Charge - ADC conversion parameter P
+ Float_t fGainN; //Charge - ADC conversi parameter N
+
+ Int_t fNInvalidP; //Number of invalid strips P
+ TArrayS *fInvalidP; //Invalid strips P-side
+ Int_t fNInvalidN; //Number of invalid strips N
+ TArrayS *fInvalidN; //Invalid strips N-side
+
+
+ //________________________________________________________________
+ //
+ // Capacitive coupling parameters
+ //________________________________________________________________
+ //
+
+ Float_t fCouplingPR;
+ Float_t fCouplingPL;
+ Float_t fCouplingNR;
+ Float_t fCouplingNL;
+
+ //________________________________________________________________
+ //
+ // Parameters for invalid strips simulatation
+ //________________________________________________________________
+
+ Float_t fNInvalid; //Meam number of invalid strips
+ Float_t fISigma; //RMS of invalid strips (Gaussian)
+
+ //________________________________________________________________
+ //
+ // temp for simulation
+ //________________________________________________________________
+ //
+
+ TArrayI *fN; // for signal
+ TArrayI *fP;
+
+ TArrayI *fNtrack1; // for tracks, signal orgin N-side
+ TArrayI *fNtrack2;
+ TArrayI *fNtrack3;
+
+ TArrayI *fPtrack1; // for tracks, signal orgin P-side
+ TArrayI *fPtrack2;
+ TArrayI *fPtrack3;
+
+public:
+ ClassDef(AliITSmoduleSSD, 1)
+};
+
+#endif
///////////////////////////////////////////////////////////////////////////////
// //
// Inner Traking System version 1 //
+// This class contains the base procedures for the Inner Tracking System //
// //
-//Begin_Html
-/*
-<img src="picts/AliITSv1Class.gif">
-</pre>
-<br clear=left>
-<font size=+2 color=red>
-<p>The responsible person for this module is
-<a href="mailto:roberto.barbera@ct.infn.it">Roberto Barbera</a>.
-</font>
-<pre>
-*/
-//End_Html
+// Authors: R. Barbera, A. Morsch.
+// version 1.
+// Created 1998.
+//
+// NOTE: THIS IS THE COARSE pre.TDR geometry of the ITS. THIS WILL NOT WORK
+// with the geometry or module classes or any analysis classes. You are
+// strongly encouraged to uses AliITSv5.
// //
///////////////////////////////////////////////////////////////////////////////
#include <TMath.h>
#include <TRandom.h>
#include <TVector.h>
+#include "AliITShit.h"
#include "AliITSv1.h"
#include "AliRun.h"
//
// Create Geometry for ITS version 0
//
- //Begin_Html
- /*
- <img src="picts/AliITSv1Tree.gif">
- */
- //End_Html
- //Begin_Html
- /*
- <img src="picts/AliITSv1.gif">
- */
- //End_Html
+ //
// Initialise the ITS after it has been built
//
AliITS::Init();
+ fMajorVersion = 1;
+ fMinorVersion = 0;
}
//_____________________________________________________________________________
// Called at every step in the ITS
//
Int_t copy, id;
- Float_t hits[7];
- Int_t vol[3];
+ Float_t hits[8];
+ Int_t vol[4];
TLorentzVector position, momentum;
TClonesArray &lhits = *fHits;
//
+ // Track status
+ vol[3] = 0;
+ if(gMC->IsTrackInside()) vol[3] += 1;
+ if(gMC->IsTrackEntering()) vol[3] += 2;
+ if(gMC->IsTrackExiting()) vol[3] += 4;
+ if(gMC->IsTrackOut()) vol[3] += 8;
+ if(gMC->IsTrackDisappeared()) vol[3] += 16;
+ if(gMC->IsTrackStop()) vol[3] += 32;
+ if(gMC->IsTrackAlive()) vol[3] += 64;
+ //
+ // Fill hit structure.
if(gMC->TrackCharge() && gMC->Edep()) {
//
// Only entering charged tracks
- if((id=gMC->CurrentVolID(copy))==fIdSens1) {
+ if((id=gMC->CurrentVolID(copy))==fIdSens[0]) {
vol[0]=1;
id=gMC->CurrentVolOffID(1,copy);
vol[1]=copy;
id=gMC->CurrentVolOffID(2,copy);
vol[2]=copy;
- } else if(id==fIdSens2) {
+ } else if(id==fIdSens[1]) {
vol[0]=2;
id=gMC->CurrentVolOffID(1,copy);
vol[1]=copy;
id=gMC->CurrentVolOffID(2,copy);
vol[2]=copy;
- } else if(id==fIdSens3) {
+ } else if(id==fIdSens[2]) {
vol[0]=3;
vol[1]=copy;
id=gMC->CurrentVolOffID(1,copy);
vol[2]=copy;
- } else if(id==fIdSens4) {
+ } else if(id==fIdSens[3]) {
vol[0]=4;
vol[1]=copy;
id=gMC->CurrentVolOffID(1,copy);
vol[2]=copy;
- } else if(id==fIdSens5) {
+ } else if(id==fIdSens[4]) {
vol[0]=5;
vol[1]=copy;
id=gMC->CurrentVolOffID(1,copy);
vol[2]=copy;
- } else if(id==fIdSens6) {
+ } else if(id==fIdSens[5]) {
vol[0]=6;
vol[1]=copy;
id=gMC->CurrentVolOffID(1,copy);
hits[2]=position[2];
hits[3]=momentum[0];
hits[4]=momentum[1];
- hits[5]=momentum[2];
+ hits[5]=momentum[2];
hits[6]=gMC->Edep();
+ hits[7]=gMC->TrackTime();
new(lhits[fNhits++]) AliITShit(fIshunt,gAlice->CurrentTrack(),vol,hits);
}
}
///////////////////////////////////////////////////////////////////////////////
// //
// Inner Traking System version 3 //
+// This class contains the base procedures for the Inner Tracking System //
+// //
+// Authors: R. Barbera, A. Morsch.
+// version 3.
+// Created 1998.
+//
+// NOTE: THIS IS THE OLD detailed TP-like geometry of the ITS. THIS WILL NOT
+// WORK with the geometry or module classes or any analysis classes. You are
+// strongly encouraged to uses AliITSv5.
// //
-//Begin_Html
-/*
-<img src="picts/AliITSv3Class.gif">
-</pre>
-<br clear=left>
-<font size=+2 color=red>
-<p>The responsible person for this module is
-<a href="mailto:roberto.barbera@ct.infn.it">Roberto Barbera</a>.
-</font>
-<pre>
-*/
-//End_Html
// //
///////////////////////////////////////////////////////////////////////////////
#include <TMath.h>
#include <TRandom.h>
#include <TVector.h>
+#include "AliITShit.h"
#include "AliITSv3.h"
#include "AliRun.h"
ClassImp(AliITSv3)
//_____________________________________________________________________________
-AliITSv3::AliITSv3() : AliITS()
-{
+AliITSv3::AliITSv3() : AliITS(){
//
// Default constructor for ITS
//
- fMinorVersion=1;
+ fMinorVersionV3=1;
}
//_____________________________________________________________________________
-AliITSv3::AliITSv3(const char *name, const char *title)
- : AliITS(name, title)
-{
+AliITSv3::AliITSv3(const char *name, const char *title) : AliITS(name, title){
//
// Standard constructor for ITS
//
- fMinorVersion=1;
+ fMinorVersionV3=1;
}
//_____________________________________________________________________________
-void AliITSv3::CreateGeometry()
-{
+void AliITSv3::CreateGeometry(){
//
// Create ITS geometry for version 3
//
- //Begin_Html
- /*
- <img src="picts/AliITSv3Tree.gif">
- */
- //End_Html
- //Begin_Html
- /*
- <img src="picts/AliITSv3.gif">
- */
- //End_Html
+ //
- const Float_t xx[14] = { 0.,0.,-14.002,-6.288,-25.212,-16.292,-35.713,-26.401,
- -45.34,-36.772,-18.74,-12.814,-14.358,0. };
- const Float_t yy[14] = { 0.,27.056,31.408,
- 25.019,27.768,22.664,22.42,18.727,15.479,13.68,-9.984,-6.175,-3.775,0. };
- const Float_t xbeg[13] = { 0.,-.352,-12.055,-8.755,-23.035,-19.085,-33.362,
- -28.859,-42.774,-36.644,-18.352,-13.085,-13.426 };
- const Float_t ybeg[13] = { .386,27.165,29.795,
- 25.377,26.48,22.632,21.487,18.305,14.94,13.509,-9.735,-5.755,-3.53 };
- const Float_t xend[13] = { 0.,-11.588,-8.208,-22.709,-18.738,-33.184,-28.719,
- -42.756,-37.027,-19.002,-13.235,-13.837,-.373 };
- const Float_t yend[13] = { 26.688,30.658,26.609,
- 27.405,23.935,22.452,19.646,15.922,13.733,-9.639,-6.446,-4.585,-.098 };
- const Float_t xarc[13] = { -.5,-13.248,-13.505,-18.622,-37.171,-42.671,-28.977,
- -33.178,-19.094,-22.781,-8.655,-11.736,-.5 };
- const Float_t yarc[13] = { .5,-4.093,-5.911,
- -9.2,13.162,15.543,19.109,22.066,23.446,27.024,26.184,30.294,26.802 };
- const Float_t rarc[13] = { .5,.7,.5,.5,.7,.5,.7,.5,.7,.5,.7,.5,.5 };
- const Float_t rr = 4.064516;
- const Float_t tteta = 63.;
- const Float_t pphi = -35.;
- const Float_t gteta = 87.78;
+ const Float_t xx[14] = { 0.000, 0.000,-14.002, -6.288,-25.212,-16.292,
+ -35.713,-26.401,-45.340,-36.772,-18.740,-12.814,
+ -14.358, 0.000};
+ const Float_t yy[14] = { 0.000, 27.056, 31.408, 25.019, 27.768, 22.664,
+ 22.420, 18.727, 15.479, 13.680, -9.984, -6.175,
+ -3.775, 0.000 };
+ const Float_t xbeg[13] = { 0.000, -0.352,-12.055, -8.755,-23.035,-19.085,
+ -33.362,-28.859,-42.774,-36.644,-18.352,-13.085,
+ -13.426 };
+ const Float_t ybeg[13] = { 0.386, 27.165, 29.795, 25.377, 26.480, 22.632,
+ 21.487, 18.305, 14.940, 13.509, -9.735, -5.755,
+ -3.53 };
+ const Float_t xend[13] = { 0.000,-11.588, -8.208,-22.709,-18.738,-33.184,
+ -28.719,-42.756,-37.027,-19.002,-13.235,-13.837,
+ -.373 };
+ const Float_t yend[13] = { 26.688, 30.658, 26.609, 27.405, 23.935, 22.452,
+ 19.646, 15.922, 13.733, -9.639, -6.446, -4.585,
+ -.098 };
+ const Float_t xarc[13] = { -0.500,-13.248,-13.505,-18.622,-37.171,-42.671,
+ -28.977,-33.178,-19.094,-22.781, -8.655,-11.736,
+ -0.500 };
+ const Float_t yarc[13] = { 0.500, -4.093, -5.911, -9.200, 13.162, 15.543,
+ 19.109, 22.066, 23.446, 27.024, 26.184, 30.294,
+ 26.802 };
+ const Float_t rarc[13] = { 0.5,0.7,0.5,0.5,0.7,0.5,0.7,
+ 0.5,0.7,0.5,0.7,0.5,0.5 };
+ const Float_t rr = 4.064516;
+ const Float_t tteta = 63.00;
+ const Float_t pphi = -35.00;
+ const Float_t gteta = 87.78;
const Double_t degrad = kPI/180.;
const Double_t raddeg = 180./kPI;
- const Double_t twopi = 2*kPI;
+ const Double_t twopi = 2*kPI;
Double_t biga, bigb;
- Float_t dcei[3], dela[3], dchi[3], dpcb[3], darc[5], dfra[10], dcer[3], dkap[3], dpla[3],
- xccc, yccc, aphi, dcop[3], dtra[3], dsil[3], atheta1011, dbus[3], dtub[3], dwat[3],
- depx[3], dits[3], atheta1314, atheta1213, atheta1112, dsup[3], xtra[8], ytra[8], ztra[8], dsrv[3];
+ Float_t dcei[3], dela[3], dchi[3], dpcb[3], darc[5],
+ dfra[10], dcer[3], dkap[3], dpla[3],
+ xccc, yccc, aphi, dcop[3], dtra[3], dsil[3],
+ atheta1011, dbus[3], dtub[3], dwat[3],
+ depx[3], dits[3], atheta1314, atheta1213, atheta1112,
+ dsup[3], xtra[8], ytra[8], ztra[8], dsrv[3];
Double_t biga1, bigb1;
- Float_t runo, xpos, ypos, zpos, rtwo, aphi1, aphi2, dtra1[3], dtra2[3], dtra3[3],
- dtra4[3], dbox1[3], dbox2[3];
- Int_t jbox1, jbox2;
- Float_t xtra1[6], ytra1[6], ztra1[6];
- Int_t i;
- Float_t xpos1, ypos1;
- Int_t j;
- Float_t angle, dcone[5], dtube[3], dpgon[10];
- Float_t rzero, xzero, yzero;
+ Float_t runo, xpos, ypos, zpos, rtwo, aphi1, aphi2,
+ dtra1[3], dtra2[3], dtra3[3],
+ dtra4[3], dbox1[3], dbox2[3];
+ Int_t jbox1, jbox2;
+ Float_t xtra1[6], ytra1[6], ztra1[6];
+ Int_t i;
+ Float_t xpos1, ypos1;
+ Int_t j;
+ Float_t angle, dcone[5], dtube[3], dpgon[10];
+ Float_t rzero, xzero, yzero;
Double_t coeffa, coeffb, coeffc;
- Int_t idrotm[5250];
- Float_t atheta, offset;
- Float_t offset1, offset2, dgh[15];
- Float_t xcc, ycc, sep, atheta12, atheta23, atheta34, atheta45, atheta56,
- atheta67, atheta78, atheta89, xxm, dal1[3], dal2[3];
- //Float_t yos;
- Float_t r1, r2, r3;
+ Int_t idrotm[5250];
+ Float_t atheta, offset;
+ Float_t offset1, offset2, dgh[15];
+ Float_t xcc, ycc, sep, atheta12, atheta23, atheta34, atheta45, atheta56,
+ atheta67, atheta78, atheta89, xxm, dal1[3], dal2[3];
+ //Float_t yos;
+ Float_t r1, r2, r3;
Double_t xcc1, ycc1, xcc2, ycc2;
- Float_t atheta910;
- const char natra[][5] =
- { "TR01","TR02","TR03","TR04","TR05","TR06","TR07","TR08"};
- const char natra1[][5] =
- {"TR11","TR12","TR13","TR14","TR15","TR16","TR17","TR18",
- "TR19","TR20","TR21","TR22","TR23","TR24","TR25","TR26"};
- const char natra2[][5] =
- {"TR31","TR32","TR33","TR34","TR35","TR36"};
- const char natra3[][5] =
- {"TR41","TR42","TR43","TR44","TR45","TR46"};
- const char natra4[][5] =
- {"TR51","TR52","TR53","TR54","TR55","TR56","TR57","TR58",
- "TR59","TR60","TR61","TR62","TR63","TR64","TR65","TR66"};
+ Float_t atheta910;
+ const char natra[][5] ={ "TR01","TR02","TR03","TR04",
+ "TR05","TR06","TR07","TR08"};
+ const char natra1[][5] ={"TR11","TR12","TR13","TR14",
+ "TR15","TR16","TR17","TR18",
+ "TR19","TR20","TR21","TR22",
+ "TR23","TR24","TR25","TR26"};
+ const char natra2[][5] ={"TR31","TR32","TR33","TR34","TR35","TR36"};
+ const char natra3[][5] ={"TR41","TR42","TR43","TR44","TR45","TR46"};
+ const char natra4[][5] ={"TR51","TR52","TR53","TR54","TR55","TR56",
+ "TR57","TR58","TR59","TR60","TR61","TR62",
+ "TR63","TR64","TR65","TR66"};
Int_t *idtmed = fIdtmed->GetArray()-199;
// --- Define a ghost volume containing the whole ITS and fill it with air
// or vacuum
- dgh[0] = 0;
- dgh[1] = 360;
- dgh[2] = 4;
- dgh[3] = -70;
- dgh[4] = 49.999;
- dgh[5] = 49.999;
- dgh[6] = -25;
- dgh[7] = 3;
- dgh[8] = 49.999;
- dgh[9] = 25;
- dgh[10] = 3;
+ dgh[0] = 0.0;
+ dgh[1] = 360.0;
+ dgh[2] = 4.0;
+ dgh[3] = -70.0;
+ dgh[4] = 49.999;
+ dgh[5] = 49.999;
+ dgh[6] = -25.0;
+ dgh[7] = 3.0;
+ dgh[8] = 49.999;
+ dgh[9] = 25.0;
+ dgh[10] = 3.0;
dgh[11] = 49.999;
- dgh[12] = 70;
+ dgh[12] = 70.0;
dgh[13] = 49.999;
dgh[14] = 49.999;
gMC->Gsvolu("ITSV", "PCON", idtmed[275], dgh, 15);
// --- Define a ghost volume containing the Silicon Pixel Detectors
// (layer #1 and #2) and fill it with air or vacuum
- xxm = (49.999-3)/(70-25);
- dgh[0] = 0.;
- dgh[1] = 360;
- dgh[2] = 4;
- dgh[3] = -25.-(9.-3.01)/xxm;
- dgh[4] = 9;
- dgh[5] = 9;
- dgh[6] = -25;
- dgh[7] = 3.01;
- dgh[8] = 9;
- dgh[9] = 25;
+ xxm = (49.999-3)/(70-25);
+ dgh[0] = 0.0;
+ dgh[1] = 360.0;
+ dgh[2] = 4.0;
+ dgh[3] = -25.-(9.-3.01)/xxm;
+ dgh[4] = 9.0;
+ dgh[5] = 9.0;
+ dgh[6] = -25.0;
+ dgh[7] = 3.01;
+ dgh[8] = 9.0;
+ dgh[9] = 25.0;
dgh[10] = 3.01;
- dgh[11] = 9;
+ dgh[11] = 9.0;
dgh[12] = 25+(9-3.01)/xxm;
- dgh[13] = 9;
- dgh[14] = 9;
+ dgh[13] = 9.0;
+ dgh[14] = 9.0;
gMC->Gsvolu("IT12", "PCON", idtmed[275], dgh, 15);
// --- Place the ghost volume in its mother volume (ITSV) and make it
dbox1[2] = 12.67;
gMC->Gsvolu("IPV1", "BOX ", idtmed[203], dbox1, 3);
- //--- Divide each element of layer #1 in three ladders along the beam direction
-
+ //--Divide each element of layer #1 in three ladders along the beam direction
+
gMC->Gsdvn("IPB1", "IPV1", 3, 3);
// --- Make the ghost volumes invisible
gMC->Gsatt("IPV1", "SEEN", 0);
gMC->Gsatt("IPB1", "SEEN", 0);
- // --- Define a volume containing the chip of pixels (silicon, layer #1)
-
- dchi[0] = .005;
- dchi[1] = .79;
+ // --- Define a volume containing the chip of pixels (silicon, layer #1)
+
+ dchi[0] = 0.005;
+ dchi[1] = 0.79;
dchi[2] = dbox1[2] / 3.;
gMC->Gsvolu("ICH1", "BOX ", idtmed[200], dchi, 3);
// --- Define a volume containing the bus of pixels (silicon, layer #1)
- dbus[0] = .01;
- dbus[1] = .64;
+ dbus[0] = 0.01;
+ dbus[1] = 0.64;
dbus[2] = 4.19;
gMC->Gsvolu("IBU1", "BOX ", idtmed[201], dbus, 3);
// --- Define a volume containing the sensitive part of pixels
// (silicon, layer #1)
- dits[0] = .0075;
- dits[1] = .64;
+ dits[0] = 0.0075;
+ dits[1] = 0.64;
dits[2] = 4.19;
gMC->Gsvolu("ITS1", "BOX ", idtmed[199], dits, 3);
-
+
// --- Place the chip into its mother (IPB1)
xpos = dbox1[0] - dchi[0];
- ypos = 0.;
- zpos = 0.;
+ ypos = 0.0;
+ zpos = 0.0;
gMC->Gspos("ICH1", 1, "IPB1", xpos, ypos, zpos, 0, "ONLY");
// --- Place the sensitive volume into its mother (IPB1)
// and fill it with air or vacuum
dbox2[0] = 0.005+0.01+0.0075;
- dbox2[1] = .79;
+ dbox2[1] = 0.79;
dbox2[2] = 16.91;
gMC->Gsvolu("IPV2", "BOX ", idtmed[203], dbox2, 3);
-
- //--- Divide each element of layer #2 in four ladders along the beam direction
+
+ //--Divide each element of layer #2 in four ladders along the beam direction
gMC->Gsdvn("IPB2", "IPV2", 4, 3);
// --- Define a volume containing the chip of pixels (silicon, layer #2)
- dchi[0] = .005;
- dchi[1] = .79;
+ dchi[0] = 0.005;
+ dchi[1] = 0.79;
dchi[2] = dbox2[2] / 4.;
gMC->Gsvolu("ICH2", "BOX ", idtmed[200], dchi, 3);
-
+
// --- Define a volume containing the bus of pixels (silicon, layer #2)
- dbus[0] = .01;
- dbus[1] = .64;
+ dbus[0] = 0.01;
+ dbus[1] = 0.64;
dbus[2] = 4.19;
gMC->Gsvolu("IBU2", "BOX ", idtmed[201], dbus, 3);
-
+
// --- Define a volume containing the sensitive part of pixels
// (silicon, layer #2)
- dits[0] = .0075;
- dits[1] = .64;
+ dits[0] = 0.0075;
+ dits[1] = 0.64;
dits[2] = 4.19;
gMC->Gsvolu("ITS2", "BOX ", idtmed[199], dits, 3);
-
+
// --- Place the chip into its mother (IPB2)
xpos = dbox1[0] - dbus[0] * 2. - dits[0] * 2. - dchi[0];
- ypos = 0.;
- zpos = 0.;
+ ypos = 0.0;
+ zpos = 0.0;
gMC->Gspos("ICH2", 1, "IPB2", xpos, ypos, zpos, 0, "ONLY");
// --- Place the sensitive volume into its mother (IPB2)
// --- Define a generic segment of an element of the mechanical support
- dsup[0] = 0.;
- dsup[1] = 0.;
- dsup[2] = 0.;
+ dsup[0] = 0.0;
+ dsup[1] = 0.0;
+ dsup[2] = 0.0;
gMC->Gsvolu("SPIX", "BOX ", idtmed[202], dsup, 0);
// --- Define a generic arc of an element of the mechanical support
- darc[0] = 0.;
- darc[1] = 0.;
- darc[2] = 0.;
+ darc[0] = 0.0;
+ darc[1] = 0.0;
+ darc[2] = 0.0;
gMC->Gsvolu("SARC", "TUBS", idtmed[202], darc, 0);
// --- Define the mechanical supports of layers #1 and #2 and place the
// number of carbon fiber supports (see sketch)
offset1 = -35.;
dsup[0] = .01;
- dsup[1] = TMath::Sqrt((xend[0] - xbeg[0]) * (xend[0] - xbeg[0]) + (yend[0] - ybeg[0]) * (yend[0] - ybeg[0])) / 20.;
- dsup[2] = 25.;
- xcc = (xx[0] + xx[1]) / 20.;
- ycc = (yy[0] + yy[1]) / 20.;
+ dsup[1] = TMath::Sqrt((xend[0] - xbeg[0]) * (xend[0] - xbeg[0]) +
+ (yend[0] - ybeg[0]) * (yend[0] - ybeg[0]) ) / 20.;
+ dsup[2] = 25.0;
+ xcc = ( xx[0] + xx[1]) / 20.;
+ ycc = ( yy[0] + yy[1]) / 20.;
xccc = (xbeg[0] + xend[0]) / 20.;
yccc = (ybeg[0] + yend[0]) / 20.;
if (xx[0] == xx[1]) {
r1 = yy[1] - yy[0];
r2 = xx[1] - xx[0];
offset2 = TMath::ATan2(r1, r2) * raddeg - 90.;
- }
+ } // end if xx[0] == xx[1]
aphi = (pphi + (i-1) * 36.) * degrad;
- xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
- yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
- xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
- ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
- xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
- ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
- zpos = 0.;
+ xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
+ yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
+ xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
+ ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
+ xpos = xpos1 * TMath::Cos(gteta * degrad) +
+ ypos1 * TMath::Sin(gteta *degrad);
+ ypos = -xpos1 * TMath::Sin(gteta * degrad) +
+ ypos1 * TMath::Cos(gteta * degrad);
+ zpos = 0.0;
atheta12 = (i-1) * 36. + offset1 + offset2 - gteta;
- AliMatrix(idrotm[(i-1) * 13 + 1100], 90., atheta12, 90., atheta12 + 90., 0., 0.);
- gMC->Gsposp("SPIX", (i-1) * 13 + 1, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1100], "ONLY", dsup, 3);
-
+ AliMatrix(idrotm[(i-1) * 13 + 1100], 90., atheta12, 90.,
+ atheta12 + 90., 0., 0.);
+ gMC->Gsposp("SPIX", (i-1) * 13 + 1, "IT12", xpos, ypos, zpos,
+ idrotm[(i-1) * 13 + 1100], "ONLY", dsup, 3);
+
// --- Place part # 2-3 (see sketch)
- offset1 = -35.;
- dsup[0] = .01;
- dsup[1] = TMath::Sqrt((xend[1] - xbeg[1]) * (xend[1] - xbeg[1]) + (yend[1] - ybeg[1]) * (yend[1] - ybeg[1])) / 20.;
- dsup[2] = 25.;
- xcc = (xx[1] + xx[2]) / 20.;
- ycc = (yy[1] + yy[2]) / 20.;
+ offset1 = -35.0;
+ dsup[0] = 0.01;
+ dsup[1] = TMath::Sqrt((xend[1] - xbeg[1]) * (xend[1] - xbeg[1]) +
+ (yend[1] - ybeg[1]) * (yend[1] - ybeg[1])) / 20.;
+ dsup[2] = 25.0;
+ xcc = ( xx[1] + xx[2]) / 20.;
+ ycc = ( yy[1] + yy[2]) / 20.;
xccc = (xbeg[1] + xend[1]) / 20.;
yccc = (ybeg[1] + yend[1]) / 20.;
if (xx[1] == xx[2]) {
r1 = yy[2] - yy[1];
r2 = xx[2] - xx[1];
offset2 = TMath::ATan2(r1, r2) * raddeg - 90.;
- }
+ } // end if xx[1] == xx[2]
aphi = (pphi + (i-1) * 36.) * degrad;
- xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
- yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
- xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
- ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
- xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
- ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
- zpos = 0.;
+ xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
+ yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
+ xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
+ ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
+ xpos = xpos1 * TMath::Cos(gteta * degrad) +
+ ypos1 * TMath::Sin(gteta * degrad);
+ ypos = -xpos1 * TMath::Sin(gteta * degrad) +
+ ypos1 * TMath::Cos(gteta * degrad);
+ zpos = 0.0;
atheta23 = (i-1) * 36. + offset1 + offset2 - gteta;
- AliMatrix(idrotm[(i-1) * 13 + 1101], 90., atheta23, 90., atheta23 + 90., 0., 0.);
- gMC->Gsposp("SPIX", (i-1) * 13 + 2, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1101], "ONLY", dsup, 3);
-
- // --- Place an element of layer #2
-
+ AliMatrix(idrotm[(i-1) * 13 + 1101], 90., atheta23, 90.,
+ atheta23 + 90., 0., 0.);
+ gMC->Gsposp("SPIX", (i-1) * 13 + 2, "IT12", xpos, ypos, zpos,
+ idrotm[(i-1) * 13 + 1101], "ONLY", dsup, 3);
+
+ // --- Place an element of layer #2
+
biga = (yy[2] - yy[1]) / (xx[2] - xx[1]);
bigb = (xx[2] * yy[1] - xx[1] * yy[2]) / (xx[2] - xx[1]) / 10.;
coeffa = biga * biga + 1.;
coeffb = biga * bigb - biga * ycc - xcc;
- coeffc = xcc * xcc + ycc * ycc - ycc * 2. * bigb + bigb * bigb - 0.08964*0.08964;
- xcc1 = (-coeffb + TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) / coeffa;
+ coeffc = xcc * xcc + ycc * ycc - ycc * 2. * bigb +
+ bigb * bigb - 0.08964*0.08964;
+ xcc1 = (-coeffb + TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) /
+ coeffa;
ycc1 = biga * xcc1 + bigb;
biga1 = -1. / biga;
bigb1 = xcc1 / biga + ycc1;
coeffa = biga1 * biga1 + 1.;
coeffb = biga1 * bigb1 - biga1 * ycc1 - xcc1;
- coeffc = xcc1 * xcc1 + ycc1 * ycc1 - ycc1 * 2. * bigb1 + bigb1 * bigb1 - (dsup[0] + dbox2[0]) * (dsup[0] + dbox2[0]);
- xcc2 = (-coeffb + TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) / coeffa;
- ycc2 = biga1 * xcc2 + bigb1;
- xpos1 = xcc2 * TMath::Cos(aphi) - ycc2 * TMath::Sin(aphi) + xzero;
- ypos1 = xcc2 * TMath::Sin(aphi) + ycc2 * TMath::Cos(aphi) + yzero;
- xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
- ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
- zpos = 0.;
+ coeffc = xcc1 * xcc1 + ycc1 * ycc1 - ycc1 * 2. * bigb1 +
+ bigb1 * bigb1 - (dsup[0] + dbox2[0]) * (dsup[0] + dbox2[0]);
+ xcc2 = (-coeffb + TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) /
+ coeffa;
+ ycc2 = biga1 * xcc2 + bigb1;
+ xpos1 = xcc2 * TMath::Cos(aphi) - ycc2 * TMath::Sin(aphi) + xzero;
+ ypos1 = xcc2 * TMath::Sin(aphi) + ycc2 * TMath::Cos(aphi) + yzero;
+ xpos = xpos1 * TMath::Cos(gteta * degrad) +
+ ypos1 * TMath::Sin(gteta *degrad);
+ ypos = -xpos1 * TMath::Sin(gteta * degrad) +
+ ypos1 * TMath::Cos(gteta * degrad);
+ zpos = 0.0;
++jbox2;
- gMC->Gspos("IPV2", jbox2, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1101], "ONLY");
-
- // --- Place part # 3-4 (see sketch)
-
- offset1 = -35.;
- dsup[0] = .01;
- dsup[1] = TMath::Sqrt((xend[2] - xbeg[2]) * (xend[2] - xbeg[2]) + (yend[2] - ybeg[2]) * (yend[2] - ybeg[2])) / 20.;
+ gMC->Gspos("IPV2", jbox2, "IT12", xpos, ypos, zpos,
+ idrotm[(i-1) * 13 + 1101], "ONLY");
+
+ // --- Place part # 3-4 (see sketch)
+
+ offset1 = -35.0;
+ dsup[0] = 0.01;
+ dsup[1] = TMath::Sqrt((xend[2] - xbeg[2]) * (xend[2] - xbeg[2]) +
+ (yend[2] - ybeg[2]) * (yend[2] - ybeg[2])) / 20.;
dsup[2] = 25.;
xcc = (xx[1] + xx[2]) / 20.;
ycc = (yy[1] + yy[2]) / 20.;
r1 = yy[3] - yy[2];
r2 = xx[3] - xx[2];
offset2 = TMath::ATan2(r1, r2) * raddeg - 90.;
- }
+ } // end if xx[2] == xx[3]
aphi = (pphi + (i-1) * 36.) * degrad;
- xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
- yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
- xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
- ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
- xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
- ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
- zpos = 0.;
+ xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
+ yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
+ xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
+ ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
+ xpos = xpos1 * TMath::Cos(gteta * degrad) +
+ ypos1 * TMath::Sin(gteta *degrad);
+ ypos = -xpos1 * TMath::Sin(gteta * degrad) +
+ ypos1 * TMath::Cos(gteta * degrad);
+ zpos = 0.0;
atheta34 = (i-1) * 36. + offset1 + offset2 - gteta;
- AliMatrix(idrotm[(i-1) * 13 + 1102], 90., atheta34, 90., atheta34 + 90., 0., 0.);
- gMC->Gsposp("SPIX", (i-1) * 13 + 3, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1102], "ONLY", dsup, 3);
-
- // --- Place part # 4-5 (see sketch)
-
- offset1 = -35.;
- dsup[0] = .01;
- dsup[1] = TMath::Sqrt((xend[3] - xbeg[3]) * (xend[3] - xbeg[3]) + (yend[3] - ybeg[3]) * (yend[3] - ybeg[3])) / 20.;
- dsup[2] = 25.;
- xcc = (xx[3] + xx[4]) / 20.;
- ycc = (yy[3] + yy[4]) / 20.;
+ AliMatrix(idrotm[(i-1) * 13 + 1102], 90., atheta34, 90.,
+ atheta34 + 90., 0., 0.);
+ gMC->Gsposp("SPIX", (i-1) * 13 + 3, "IT12", xpos, ypos, zpos,
+ idrotm[(i-1) * 13 + 1102], "ONLY", dsup, 3);
+
+ // --- Place part # 4-5 (see sketch)
+
+ offset1 = -35.0;
+ dsup[0] = 0.01;
+ dsup[1] = TMath::Sqrt((xend[3] - xbeg[3]) * (xend[3] - xbeg[3]) +
+ (yend[3] - ybeg[3]) * (yend[3] - ybeg[3])) / 20.;
+ dsup[2] = 25.0;
+ xcc = ( xx[3] + xx[4]) / 20.;
+ ycc = ( yy[3] + yy[4]) / 20.;
xccc = (xbeg[3] + xend[3]) / 20.;
yccc = (ybeg[3] + yend[3]) / 20.;
if (xx[3] == xx[4]) {
r1 = yy[4] - yy[3];
r2 = xx[4] - xx[3];
offset2 = TMath::ATan2(r1, r2) * raddeg - 90.;
- }
+ } // end if xx[3] == xx[4]
aphi = (pphi + (i-1) * 36.) * degrad;
- xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
- yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
- xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
- ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
- xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
- ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
- zpos = 0.;
+ xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
+ yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
+ xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
+ ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
+ xpos = xpos1 * TMath::Cos(gteta * degrad) +
+ ypos1 * TMath::Sin(gteta *degrad);
+ ypos = -xpos1 * TMath::Sin(gteta * degrad) +
+ ypos1 * TMath::Cos(gteta * degrad);
+ zpos = 0.0;
atheta45 = (i-1) * 36. + offset1 + offset2 - gteta;
- AliMatrix(idrotm[(i-1) * 13 + 1103], 90., atheta45, 90., atheta45 + 90., 0., 0.);
- gMC->Gsposp("SPIX", (i-1) * 13 + 4, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1103], "ONLY", dsup, 3);
-
- // --- Place an element of layer #2
-
+ AliMatrix(idrotm[(i-1) * 13 + 1103], 90., atheta45, 90.,
+ atheta45 + 90., 0., 0.);
+ gMC->Gsposp("SPIX", (i-1) * 13 + 4, "IT12", xpos, ypos, zpos,
+ idrotm[(i-1) * 13 + 1103], "ONLY", dsup, 3);
+
+ // --- Place an element of layer #2
+
biga = (yy[4] - yy[3]) / (xx[4] - xx[3]);
bigb = (xx[4] * yy[3] - xx[3] * yy[4]) / (xx[4] - xx[3]) / 10.;
coeffa = biga * biga + 1.;
coeffb = biga * bigb - biga * ycc - xcc;
- coeffc = xcc * xcc + ycc * ycc - ycc * 2. * bigb + bigb * bigb - .014285030400000001;
- xcc1 = (-coeffb - TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) / coeffa;
+ coeffc = xcc * xcc + ycc * ycc - ycc * 2. * bigb +
+ bigb * bigb - .014285030400000001;
+ xcc1 = (-coeffb - TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) /
+ coeffa;
ycc1 = biga * xcc1 + bigb;
biga1 = -1. / biga;
bigb1 = xcc1 / biga + ycc1;
coeffa = biga1 * biga1 + 1.;
coeffb = biga1 * bigb1 - biga1 * ycc1 - xcc1;
- coeffc = xcc1 * xcc1 + ycc1 * ycc1 - ycc1 * 2. * bigb1 + bigb1 * bigb1 - (dsup[0] + dbox2[0]) * (dsup[0] + dbox2[0]);
- xcc2 = (-coeffb + TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) / coeffa;
- ycc2 = biga1 * xcc2 + bigb1;
- xpos1 = xcc2 * TMath::Cos(aphi) - ycc2 * TMath::Sin(aphi) + xzero;
- ypos1 = xcc2 * TMath::Sin(aphi) + ycc2 * TMath::Cos(aphi) + yzero;
- xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
- ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
- zpos = 0.;
+ coeffc = xcc1 * xcc1 + ycc1 * ycc1 - ycc1 * 2. * bigb1 +
+ bigb1 * bigb1 - (dsup[0] + dbox2[0]) * (dsup[0] + dbox2[0]);
+ xcc2 = (-coeffb + TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) /
+ coeffa;
+ ycc2 = biga1 * xcc2 + bigb1;
+ xpos1 = xcc2 * TMath::Cos(aphi) - ycc2 * TMath::Sin(aphi) + xzero;
+ ypos1 = xcc2 * TMath::Sin(aphi) + ycc2 * TMath::Cos(aphi) + yzero;
+ xpos = xpos1 * TMath::Cos(gteta * degrad) +
+ ypos1 * TMath::Sin(gteta *degrad);
+ ypos = -xpos1 * TMath::Sin(gteta * degrad) +
+ ypos1 * TMath::Cos(gteta * degrad);
+ zpos = 0.0;
++jbox2;
- gMC->Gspos("IPV2", jbox2, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1103], "ONLY");
-
+ gMC->Gspos("IPV2", jbox2, "IT12", xpos, ypos, zpos,
+ idrotm[(i-1) * 13 + 1103], "ONLY");
+
// --- Place part # 5-6 (see sketch)
offset1 = -35.;
dsup[0] = .01;
- dsup[1] = TMath::Sqrt((xend[4] - xbeg[4]) * (xend[4] - xbeg[4]) + (yend[4] - ybeg[4]) * (yend[4] - ybeg[4])) / 20.;
+ dsup[1] = TMath::Sqrt((xend[4] - xbeg[4]) * (xend[4] - xbeg[4]) +
+ (yend[4] - ybeg[4]) * (yend[4] - ybeg[4])) / 20.;
dsup[2] = 25.;
xcc = (xx[4] + xx[5]) / 20.;
ycc = (yy[4] + yy[5]) / 20.;
offset2 = TMath::ATan2(r1, r2) * raddeg - 90.;
}
aphi = (pphi + (i-1) * 36.) * degrad;
- xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
- yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
- xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
- ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
- xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
- ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
+ xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
+ yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
+ xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
+ ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
+ xpos = xpos1 * TMath::Cos(gteta * degrad) +
+ ypos1 * TMath::Sin(gteta *degrad);
+ ypos = -xpos1 * TMath::Sin(gteta * degrad) +
+ ypos1 * TMath::Cos(gteta * degrad);
zpos = 0.;
atheta56 = (i-1) * 36. + offset1 + offset2 - gteta;
- AliMatrix(idrotm[(i-1) * 13 + 1104], 90., atheta56, 90., atheta56 + 90., 0., 0.);
- gMC->Gsposp("SPIX", (i-1) * 13 + 5, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1104], "ONLY", dsup, 3);
-
+ AliMatrix(idrotm[(i-1) * 13 + 1104], 90., atheta56, 90.,
+ atheta56 + 90., 0., 0.);
+ gMC->Gsposp("SPIX", (i-1) * 13 + 5, "IT12", xpos, ypos, zpos,
+ idrotm[(i-1) * 13 + 1104], "ONLY", dsup, 3);
+
// --- Place part # 6-7 (see sketch)
- offset1 = -35.;
- dsup[0] = .01;
- dsup[1] = TMath::Sqrt((xend[5] - xbeg[5]) * (xend[5] - xbeg[5]) + (yend[5] - ybeg[5]) * (yend[5] - ybeg[5])) / 20.;
- dsup[2] = 25.;
+ offset1 = -35.0;
+ dsup[0] = 0.01;
+ dsup[1] = TMath::Sqrt((xend[5] - xbeg[5]) * (xend[5] - xbeg[5]) +
+ (yend[5] - ybeg[5]) * (yend[5] - ybeg[5])) / 20.;
+ dsup[2] = 25.0;
xcc = (xx[5] + xx[6]) / 20.;
ycc = (yy[5] + yy[6]) / 20.;
xccc = (xbeg[5] + xend[5]) / 20.;
r1 = yy[6] - yy[5];
r2 = xx[6] - xx[5];
offset2 = TMath::ATan2(r1, r2) * raddeg - 90.;
- }
+ } // end if xx[5] == xx[6]
aphi = (pphi + (i-1) * 36.) * degrad;
- xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
- yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
- xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
- ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
- xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
- ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
+ xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
+ yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
+ xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
+ ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
+ xpos = xpos1 * TMath::Cos(gteta * degrad) +
+ ypos1 * TMath::Sin(gteta *degrad);
+ ypos = -xpos1 * TMath::Sin(gteta * degrad) +
+ ypos1 * TMath::Cos(gteta * degrad);
zpos = 0.;
atheta67 = (i-1) * 36. + offset1 + offset2 - gteta;
- AliMatrix(idrotm[(i-1) * 13 + 1105], 90., atheta67, 90., atheta67 + 90., 0., 0.);
- gMC->Gsposp("SPIX", (i-1) * 13 + 6, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1105], "ONLY", dsup, 3);
-
+ AliMatrix(idrotm[(i-1) * 13 + 1105], 90., atheta67, 90.,
+ atheta67 + 90., 0., 0.);
+ gMC->Gsposp("SPIX", (i-1) * 13 + 6, "IT12", xpos, ypos, zpos,
+ idrotm[(i-1) * 13 + 1105], "ONLY", dsup, 3);
+
// --- Place an element of layer #2
biga = (yy[6] - yy[5]) / (xx[6] - xx[5]);
bigb = (xx[6] * yy[5] - xx[5] * yy[6]) / (xx[6] - xx[5]) / 10.;
coeffa = biga * biga + 1.;
coeffb = biga * bigb - biga * ycc - xcc;
- coeffc = xcc * xcc + ycc * ycc - ycc * 2. * bigb + bigb * bigb - .014285030400000001;
- xcc1 = (-coeffb - TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) / coeffa;
+ coeffc = xcc * xcc + ycc * ycc - ycc * 2. * bigb +
+ bigb * bigb - .014285030400000001;
+ xcc1 = (-coeffb - TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) /
+ coeffa;
ycc1 = biga * xcc1 + bigb;
biga1 = -1. / biga;
bigb1 = xcc1 / biga + ycc1;
coeffa = biga1 * biga1 + 1.;
coeffb = biga1 * bigb1 - biga1 * ycc1 - xcc1;
- coeffc = xcc1 * xcc1 + ycc1 * ycc1 - ycc1 * 2. * bigb1 + bigb1 * bigb1 - (dsup[0] + dbox2[0]) * (dsup[0] + dbox2[0]);
- xcc2 = (-coeffb - TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) / coeffa;
- ycc2 = biga1 * xcc2 + bigb1;
- xpos1 = xcc2 * TMath::Cos(aphi) - ycc2 * TMath::Sin(aphi) + xzero;
- ypos1 = xcc2 * TMath::Sin(aphi) + ycc2 * TMath::Cos(aphi) + yzero;
- xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
- ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
- zpos = 0.;
+ coeffc = xcc1 * xcc1 + ycc1 * ycc1 - ycc1 * 2. * bigb1 +
+ bigb1 * bigb1 - (dsup[0] + dbox2[0]) * (dsup[0] + dbox2[0]);
+ xcc2 = (-coeffb - TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) /
+ coeffa;
+ ycc2 = biga1 * xcc2 + bigb1;
+ xpos1 = xcc2 * TMath::Cos(aphi) - ycc2 * TMath::Sin(aphi) + xzero;
+ ypos1 = xcc2 * TMath::Sin(aphi) + ycc2 * TMath::Cos(aphi) + yzero;
+ xpos = xpos1 * TMath::Cos(gteta * degrad) +
+ ypos1 * TMath::Sin(gteta *degrad);
+ ypos = -xpos1 * TMath::Sin(gteta * degrad) +
+ ypos1 * TMath::Cos(gteta * degrad);
+ zpos = 0.0;
++jbox2;
- gMC->Gspos("IPV2", jbox2, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1105], "ONLY");
+ gMC->Gspos("IPV2", jbox2, "IT12", xpos, ypos, zpos,
+ idrotm[(i-1) * 13 + 1105], "ONLY");
// --- Place part # 7-8 (see sketch)
offset1 = -35.;
dsup[0] = .01;
- dsup[1] = TMath::Sqrt((xend[6] - xbeg[6]) * (xend[6] - xbeg[6]) + (yend[6] - ybeg[6]) * (yend[6] - ybeg[6])) / 20.;
+ dsup[1] = TMath::Sqrt((xend[6] - xbeg[6]) * (xend[6] - xbeg[6]) +
+ (yend[6] - ybeg[6]) * (yend[6] - ybeg[6])) / 20.;
dsup[2] = 25.;
xcc = (xx[6] + xx[7]) / 20.;
ycc = (yy[6] + yy[7]) / 20.;
r1 = yy[7] - yy[6];
r2 = xx[7] - xx[6];
offset2 = TMath::ATan2(r1, r2) * raddeg - 90.;
- }
+ } // end if
aphi = (pphi + (i-1) * 36.) * degrad;
- xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
- yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
- xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
- ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
- xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
- ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
+ xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
+ yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
+ xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
+ ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
+ xpos = xpos1 * TMath::Cos(gteta * degrad) +
+ ypos1 * TMath::Sin(gteta *degrad);
+ ypos = -xpos1 * TMath::Sin(gteta * degrad) +
+ ypos1 * TMath::Cos(gteta * degrad);
zpos = 0.;
atheta78 = (i-1) * 36. + offset1 + offset2 - gteta;
- AliMatrix(idrotm[(i-1) * 13 + 1106], 90., atheta78, 90., atheta78 + 90., 0., 0.);
- gMC->Gsposp("SPIX", (i-1) * 13 + 7, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1106], "ONLY", dsup, 3);
+ AliMatrix(idrotm[(i-1) * 13 + 1106], 90., atheta78, 90.,
+ atheta78 + 90., 0., 0.);
+ gMC->Gsposp("SPIX", (i-1) * 13 + 7, "IT12", xpos, ypos, zpos,
+ idrotm[(i-1) * 13 + 1106], "ONLY", dsup, 3);
// --- Place part # 8-9 (see sketch)
offset1 = -35.;
dsup[0] = .01;
- dsup[1] = TMath::Sqrt((xend[7] - xbeg[7]) * (xend[7] - xbeg[7]) + (yend[7] - ybeg[7]) * (yend[7] - ybeg[7])) / 20.;
+ dsup[1] = TMath::Sqrt((xend[7] - xbeg[7]) * (xend[7] - xbeg[7]) +
+ (yend[7] - ybeg[7]) * (yend[7] - ybeg[7])) / 20.;
dsup[2] = 25.;
xcc = (xx[7] + xx[8]) / 20.;
ycc = (yy[7] + yy[8]) / 20.;
offset2 = TMath::ATan2(r1, r2) * raddeg - 90.;
}
aphi = (pphi + (i-1) * 36.) * degrad;
- xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
- yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
- xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
- ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
- xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
- ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
+ xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
+ yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
+ xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
+ ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
+ xpos = xpos1 * TMath::Cos(gteta * degrad) +
+ ypos1 * TMath::Sin(gteta *degrad);
+ ypos = -xpos1 * TMath::Sin(gteta * degrad) +
+ ypos1 * TMath::Cos(gteta * degrad);
zpos = 0.;
atheta89 = (i-1) * 36. + offset1 + offset2 - gteta;
- AliMatrix(idrotm[(i-1) * 13 + 1107], 90., atheta89, 90., atheta89 + 90., 0., 0.);
- gMC->Gsposp("SPIX", (i-1) * 13 + 8, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1107], "ONLY", dsup, 3);
+ AliMatrix(idrotm[(i-1) * 13 + 1107], 90., atheta89, 90.,
+ atheta89 + 90., 0., 0.);
+ gMC->Gsposp("SPIX", (i-1) * 13 + 8, "IT12", xpos, ypos, zpos,
+ idrotm[(i-1) * 13 + 1107], "ONLY", dsup, 3);
// --- Place an element of layer #2
bigb = (xx[8] * yy[7] - xx[7] * yy[8]) / (xx[8] - xx[7]) / 10.;
coeffa = biga * biga + 1.;
coeffb = biga * bigb - biga * ycc - xcc;
- coeffc = xcc * xcc + ycc * ycc - ycc * 2. * bigb + bigb * bigb - .014285030400000001;
- xcc1 = (-coeffb - TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) / coeffa;
+ coeffc = xcc * xcc + ycc * ycc - ycc * 2. * bigb +
+ bigb * bigb - .014285030400000001;
+ xcc1 = (-coeffb - TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) /
+ coeffa;
ycc1 = biga * xcc1 + bigb;
biga1 = -1. / biga;
bigb1 = xcc1 / biga + ycc1;
coeffa = biga1 * biga1 + 1.;
coeffb = biga1 * bigb1 - biga1 * ycc1 - xcc1;
- coeffc = xcc1 * xcc1 + ycc1 * ycc1 - ycc1 * 2. * bigb1 + bigb1 * bigb1 - (dsup[0] + dbox2[0]) * (dsup[0] + dbox2[0]);
- xcc2 = (-coeffb - TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) / coeffa;
- ycc2 = biga1 * xcc2 + bigb1;
- xpos1 = xcc2 * TMath::Cos(aphi) - ycc2 * TMath::Sin(aphi) + xzero;
- ypos1 = xcc2 * TMath::Sin(aphi) + ycc2 * TMath::Cos(aphi) + yzero;
- xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
- ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
- zpos = 0.;
+ coeffc = xcc1 * xcc1 + ycc1 * ycc1 - ycc1 * 2. * bigb1 +
+ bigb1 * bigb1 - (dsup[0] + dbox2[0]) * (dsup[0] + dbox2[0]);
+ xcc2 = (-coeffb - TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) /
+ coeffa;
+ ycc2 = biga1 * xcc2 + bigb1;
+ xpos1 = xcc2 * TMath::Cos(aphi) - ycc2 * TMath::Sin(aphi) + xzero;
+ ypos1 = xcc2 * TMath::Sin(aphi) + ycc2 * TMath::Cos(aphi) + yzero;
+ xpos = xpos1 * TMath::Cos(gteta * degrad) +
+ ypos1 * TMath::Sin(gteta *degrad);
+ ypos = -xpos1 * TMath::Sin(gteta * degrad) +
+ ypos1 * TMath::Cos(gteta * degrad);
+ zpos = 0.0;
++jbox2;
- gMC->Gspos("IPV2", jbox2, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1107], "ONLY");
-
+ gMC->Gspos("IPV2", jbox2, "IT12", xpos, ypos, zpos,
+ idrotm[(i-1) * 13 + 1107], "ONLY");
+
// --- Place part # 9-10 (see sketch)
offset1 = -35.;
dsup[0] = .01;
- dsup[1] = TMath::Sqrt((xend[8] - xbeg[8]) * (xend[8] - xbeg[8]) + (yend[8] - ybeg[8]) * (yend[8] - ybeg[8])) / 20.;
+ dsup[1] = TMath::Sqrt((xend[8] - xbeg[8]) * (xend[8] - xbeg[8]) +
+ (yend[8] - ybeg[8]) * (yend[8] - ybeg[8])) / 20.;
dsup[2] = 25.;
xcc = (xx[8] + xx[9]) / 20.;
ycc = (yy[8] + yy[9]) / 20.;
// --- Define SSD with the 35+39 lay-out
- if (fMinorVersion < 3) {
+ if (fMinorVersionV3 < 3) {
//--- Define ghost volume containing the Strip Detectors and fill it with air
// or vacuum
// --- Define SSD with the 32+36 lay-out
- if (fMinorVersion >2 && fMinorVersion < 6) {
+ if (fMinorVersionV3 >2 && fMinorVersionV3 < 6) {
//--- Define ghost volume containing the Strip Detectors and fill it with air
// or vacuum
// GOTO 8901 ! skip outer wall
- if (fMinorVersion == 0 || fMinorVersion == 3) {
+ if (fMinorVersionV3 == 0 || fMinorVersionV3 == 3) {
dits[0] = 49.9;
dits[1] = dits[0] + .06926;
// GOTO 9012 ! skip octagonal frame
- if (fMinorVersion == 1) {
+ if (fMinorVersionV3 == 1) {
rzero = 34.;
dtra[0] = .92;
gMC->Gspos(natra1[15], 1, "ITSV", xpos, ypos, zpos, idrotm[5115], "ONLY");
- } else if (fMinorVersion == 4) {
+ } else if (fMinorVersionV3 == 4) {
rzero = 34.;
// GOTO 9123 ! skip hexagonal frame
- if (fMinorVersion == 2) {
+ if (fMinorVersionV3 == 2) {
rzero = 33.5;
dtra2[0] = .92;
gMC->Gspos(natra4[15], 1, "ITSV", xpos, ypos, zpos, idrotm[5225], "ONLY");
- } else if (fMinorVersion == 5) {
+ } else if (fMinorVersionV3 == 5) {
rzero = 33.5;
gMC->Gsvolu("RP04", "PGON", idtmed[274], dpgon, 10);
gMC->Gspos("RP04", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
- if (fMinorVersion < 3 ) {
+ if (fMinorVersionV3 < 3 ) {
offset2 = 5.2;
dpgon[0] = offset2 + 360./(2.*35.);
dpgon[1] = 360.;
gMC->Gsvolu("RP06", "PGON", idtmed[274], dpgon, 10);
gMC->Gspos("RP06", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
}
- if (fMinorVersion > 2 && fMinorVersion < 6) {
+ if (fMinorVersionV3 > 2 && fMinorVersionV3 < 6) {
offset2 = 5.2;
dpgon[0] = offset2 + 5.625;
dpgon[1] = 360.;
gMC->Gsvolu("LP04", "PGON", idtmed[274], dpgon, 10);
gMC->Gspos("LP04", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
- if (fMinorVersion < 3) {
+ if (fMinorVersionV3 < 3) {
offset2 = 5.2;
dpgon[0] = offset2 + 360./(2.*35.);
dpgon[1] = 360.;
gMC->Gsvolu("LP06", "PGON", idtmed[274], dpgon, 10);
gMC->Gspos("LP06", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
}
- if (fMinorVersion > 2 && fMinorVersion < 6) {
+ if (fMinorVersionV3 > 2 && fMinorVersionV3 < 6) {
offset2 = 5.2;
dpgon[0] = offset2 + 5.625;
dpgon[1] = 360.;
if (fEuclidOut) {
gMC->WriteEuclid("ITSgeometry", "ITSV", 1, 5);
}
+ fMinorVersion = fMinorVersionV3;
}
//_____________________________________________________________________________
// Initialise its after it is built
//
AliITS::Init();
+ fMajorVersion = 3;
+ fMinorVersion = fMinorVersionV3;
}
//_____________________________________________________________________________
// Called at every step in ITS
//
Int_t copy, id;
- Float_t hits[7];
- Int_t vol[3];
+ Float_t hits[8];
+ Int_t vol[4];
TLorentzVector position, momentum;
TClonesArray &lhits = *fHits;
//
+ // Track status
+ vol[3] = 0;
+ if(gMC->IsTrackInside()) vol[3] += 1;
+ if(gMC->IsTrackEntering()) vol[3] += 2;
+ if(gMC->IsTrackExiting()) vol[3] += 4;
+ if(gMC->IsTrackOut()) vol[3] += 8;
+ if(gMC->IsTrackDisappeared()) vol[3] += 16;
+ if(gMC->IsTrackStop()) vol[3] += 32;
+ if(gMC->IsTrackAlive()) vol[3] += 64;
+ //
+ // Fill hit structure.
if(gMC->TrackCharge() && gMC->Edep()) {
//
// Only entering charged tracks
- if((id=gMC->CurrentVolID(copy))==fIdSens1) {
+ if((id=gMC->CurrentVolID(copy))==fIdSens[0]) {
vol[0]=1;
id=gMC->CurrentVolOffID(1,copy);
vol[1]=copy;
id=gMC->CurrentVolOffID(2,copy);
vol[2]=copy;
- } else if(id==fIdSens2) {
+ } else if(id==fIdSens[1]) {
vol[0]=2;
id=gMC->CurrentVolOffID(1,copy);
vol[1]=copy;
id=gMC->CurrentVolOffID(2,copy);
vol[2]=copy;
- } else if(id==fIdSens3) {
+ } else if(id==fIdSens[2]) {
vol[0]=3;
vol[1]=copy;
id=gMC->CurrentVolOffID(1,copy);
vol[2]=copy;
- } else if(id==fIdSens4) {
+ } else if(id==fIdSens[3]) {
vol[0]=4;
vol[1]=copy;
id=gMC->CurrentVolOffID(1,copy);
vol[2]=copy;
- } else if(id==fIdSens5) {
+ } else if(id==fIdSens[4]) {
vol[0]=5;
vol[1]=copy;
id=gMC->CurrentVolOffID(1,copy);
vol[2]=copy;
- } else if(id==fIdSens6) {
+ } else if(id==fIdSens[5]) {
vol[0]=6;
vol[1]=copy;
id=gMC->CurrentVolOffID(1,copy);
hits[4]=momentum[1];
hits[5]=momentum[2];
hits[6]=gMC->Edep();
+ hits[7]=gMC->TrackTime();
new(lhits[fNhits++]) AliITShit(fIshunt,gAlice->CurrentTrack(),vol,hits);
}
}
class AliITSv3 : public AliITS {
protected:
- Int_t fMinorVersion; //Minor version identifier
+ Int_t fMinorVersionV3; //Minor version identifier
public:
AliITSv3();
virtual void CreateMaterials();
virtual void Init();
virtual Int_t IsVersion() const {return 3;}
- virtual inline void SetMinorVersion(Int_t version) {fMinorVersion=version;}
+ virtual inline void SetMinorVersion(Int_t version) {fMinorVersionV3=version;}
virtual void StepManager();
ClassDef(AliITSv3,1) //Hits manager for set:ITS version 3
// Inner Traking System version 5 //
// This class contains the base procedures for the Inner Tracking System //
// //
-//Begin_Html
-/*
-<img src="picts/AliITSv5Class.gif">
-</pre>
-<br clear=left>
-<font size=+2 color=red>
-<p>The responsible person for this module is
-<a href="mailto:roberto.barbera@ct.infn.it">Roberto Barbera</a>.
-</font>
-<pre>
-*/
-//End_Html
+// Authors: R. Barbera, B. S. Nilsen.
+// version 5.
+// Created September 17 1999.
// //
///////////////////////////////////////////////////////////////////////////////
-#include <stdio.h>
-
+#include <stdio.h>
+#include <stdlib.h>
#include <TMath.h>
-#include "AliITSv5.h"
+
#include "AliRun.h"
-#include "stdlib.h"
#include "TSystem.h"
+#include "AliITShit.h"
+#include "AliITS.h"
+#include "AliITSv5.h"
+#include "AliITSgeom.h"
ClassImp(AliITSv5)
//_____________________________________________________________________________
-AliITSv5::AliITSv5() : AliITS()
-{
- //
- // Default constructor for the ITS
- //
+AliITSv5::AliITSv5() : AliITS(){
+ //
+ // Standard constructor for the ITS
+ //
+ fId5N = 5;
+ fId5Name = new char*[fId5N];
+ fId5Name[0] = "ITS1";
+ fId5Name[1] = "ITS2";
+ fId5Name[2] = "ITS3";
+ fId5Name[3] = "ITS4";
+ fId5Name[4] = "ITS5";
+ fId5Name[5] = "ITS6";
}
-
//_____________________________________________________________________________
-AliITSv5::AliITSv5(const char *name, const char *title)
- : AliITS(name, title)
-{
- //
- // Standard constructor for the ITS
- //
- fEuclidMaterial="$(ALICE_ROOT)/Euclid/ITSgeometry_5.tme";
- fEuclidGeometry="$(ALICE_ROOT)/Euclid/ITSgeometry_5.euc";
+AliITSv5::AliITSv5(const char *name, const char *title) : AliITS(name, title){
+ //
+ // Standard constructor for the ITS
+ //
+ fId5N = 6;
+ fId5Name = new char*[fId5N];
+ fId5Name[0] = "ITS1";
+ fId5Name[1] = "ITS2";
+ fId5Name[2] = "ITS3";
+ fId5Name[3] = "ITS4";
+ fId5Name[4] = "ITS5";
+ fId5Name[5] = "ITS6";
+
+ fEuclidMaterial = "$ALICE_ROOT/Euclid/ITSgeometry_5.tme";
+ fEuclidGeometry = "$ALICE_ROOT/Euclid/ITSgeometry_5.euc";
}
//_____________________________________________________________________________
-void AliITSv5::CreateMaterials()
-{
+void AliITSv5::CreateMaterials(){
//
// Read materials for the ITS
//
- char *filtmp;
- //
- filtmp=gSystem->ExpandPathName(fEuclidMaterial.Data());
+ char *filtmp;
+//
+ filtmp = gSystem->ExpandPathName(fEuclidMaterial.Data());
+// FILE *file = fopen(fEuclidMaterial.Data(),"r");
FILE *file = fopen(filtmp,"r");
- delete [] filtmp;
if(file) {
fclose(file);
- gAlice->ReadEuclidMedia(fEuclidMaterial.Data(),this);
+// gAlice->ReadEuclidMedia(fEuclidMaterial.Data(),this);
+ gAlice->ReadEuclidMedia(filtmp,this);
} else {
- Error("CreateMaterials"," THE MEDIA FILE %s DOES NOT EXIST !",fEuclidMaterial.Data());
+ Error("CreateMaterials"," THE MEDIA FILE %s DOES NOT EXIST !",
+// fEuclidMaterial.Data());
+ filtmp);
exit(1);
- }
+ } // end if(file)
}
//_____________________________________________________________________________
-void AliITSv5::CreateGeometry()
-{
- //
- // Read geometry for the ITS
- //
+void AliITSv5::CreateGeometry(){
+//////////////////////////////////////////////////////////////////////
+// This is the geometry used for the ITS Pre-TDR and comes from an
+// Euclid to Geant conversion. The only difference
+// is in the details of the ITS supports. The detectors elements,
+// detector numbering, and local and global reference frames are shown in
+// the following figures.
+//Begin_Html
+/*
+<img src="figures/its1+2_convention_front_5.gif">
+</pre>
+<br clear=left>
+<font size=+2 color=red>
+<p>This shows the front view of the SPDs.
+</font>
+<pre>
+<img src="figures/its1+2_convention_side_5.gif">
+</pre>
+<br clear=left>
+<font size=+2 color=red>
+<p>This shows the perspective view of the SPDs.
+</font>
+<img src="figures/its1+2_tree.gif">
+</pre>
+<br clear=left>
+<font size=+2 color=red>
+<p>This shows the geometry Tree for the SPDs.
+</font>
+<pre>
+
+<pre>
+<img src="figures/its3+4_convention_front_5.gif">
+</pre>
+<br clear=left>
+<font size=+2 color=red>
+<p>This shows the front view of the SDDs.
+</font>
+<pre>
+<img src="figures/its3+4_convention_side_5.gif">
+</pre>
+<br clear=left>
+<font size=+2 color=red>
+<p>This shows the perspective view of the SDDs.
+</font>
+<img src="figures/its3+4_tree.gif">
+</pre>
+<br clear=left>
+<font size=+2 color=red>
+<p>This shows the geometry Tree for the SDDs.
+</font>
+<pre>
- char topvol[5];
- char *filtmp;
+<pre>
+<img src="figures/its5+6_convention_front_5.gif">
+</pre>
+<br clear=left>
+<font size=+2 color=red>
+<p>This shows the front view of the SSDs.
+</font>
+<pre>
+<img src="figures/its5+6_convention_side_5.gif">
+</pre>
+<br clear=left>
+<font size=+2 color=red>
+<p>This shows the perspective view of the SSDs.
+</font>
+<pre>
+<img src="figures/its5+6_tree.gif">
+</pre>
+<br clear=left>
+<font size=+2 color=red>
+<p>This shows the geometry Tree for the SSDs.
+</font>
+<pre>
+
+
+<img src="figures/its_layer1-6_2.gif">
+</pre>
+<br clear=left>
+<font size=+2 color=red>
+<p>This shows the front view of the whole ITS..
+</font>
+<pre>
+
+<img src="figures/its_layer1-6_1.gif">
+</pre>
+<br clear=left>
+<font size=+2 color=red>
+<p>This shows the perspective view of the whole ITS..
+</font>
+<pre>
+
+<img src="figures/its1-6_tree.gif">
+</pre>
+<br clear=left>
+<font size=+2 color=red>
+<p>This shows the geometry Tree for the whole ITS.
+</font>
+<pre>
+*/
+//End_Html
+//
//
- filtmp=gSystem->ExpandPathName(fEuclidGeometry.Data());
+// Here are shown the details of the ITS support cones and services.
+// First is a GEANT tree showing the organization of all of the volumes
+// that make up the ITS supports and services.
+//Begin_Html
+/*
+<img src="figures/supports_tree.gif">
+ */
+//End_Html
+// What follows are a number of figures showing what these support
+// structures look like.
+//Begin_Html
+/*
+
+<img src="figures/supports_3.gif">
+</pre>
+<br clear=left>
+<font size=+2 color=red>
+<p>This shows the geometry of the supports for the Drift and Strip layers only.
+</font>
+<pre>
+
+<img src="figures/supports_2.gif">
+</pre>
+<br clear=left>
+<font size=+2 color=red>
+<p>This shows the geometry of the supports for the Drift and Strip layers in front cut out.
+</font>
+<pre>
+
+<img src="figures/supports_1.gif">
+</pre>
+<br clear=left>
+<font size=+2 color=red>
+<p>This shows the geometry of the supports for the Drift and Strip layers in a back cut out..
+</font>
+<pre>
+
+<img src="figures/suppssd.gif">
+</pre>
+<br clear=left>
+<font size=+2 color=red>
+<p>This shows the geometry for the Strip layers supports.
+</font>
+<pre>
+
+<img src="figures/suppsdd.gif">
+</pre>
+<br clear=left>
+<font size=+2 color=red>
+<p>This shows the geometry for the Drift layers supports.
+</font>
+<pre>
+ */
+//End_Html
+////////////////////////////////////////////////////////////////////////
+// Read geometry for the ITS
+//
+
+ Int_t size;
+ char topvol[5];
+ char *filtmp;
+//
+ filtmp = gSystem->ExpandPathName(fEuclidGeometry.Data());
FILE *file = fopen(filtmp,"r");
delete [] filtmp;
if(file) {
fclose(file);
+ printf("Ready to read Euclid geometry file\n");
gAlice->ReadEuclid(fEuclidGeometry.Data(),this,topvol);
+ printf("Read in euclid geometries\n");
} else {
- Error("CreateGeometry"," THE GEOM FILE %s DOES NOT EXIST !",fEuclidGeometry.Data());
+ Error("CreateGeometry"," THE GEOM FILE %s DOES NOT EXIST !",
+ fEuclidGeometry.Data());
exit(1);
- }
+ } // end if(file)
//
- // --- Place the ITS ghost volume ITSV in its mother volume (ALIC) and make it
+ //---Place the ITS ghost volume ITSV in its mother volume (ALIC) and make it
// invisible
//
gMC->Gspos("ITSV",1,"ALIC",0,0,0,0,"ONLY");
//
- // --- Outputs the geometry tree in the EUCLID/CAD format
+ //---Outputs the geometry tree in the EUCLID/CAD format
if (fEuclidOut) {
gMC->WriteEuclid("ITSgeometry", "ITSV", 1, 5);
- }
+ } // end if (fEuclidOut)
+
+ filtmp = gSystem->ExpandPathName(fEuclidGeometry.Data());
+ size = strlen(filtmp);
+ if(size>4){
+ filtmp[size-3] = 'd'; // change from .euc to .det
+ filtmp[size-2] = 'e';
+ filtmp[size-1] = 't';
+ file = fopen(filtmp,"r");
+ if(file){ // if file exists use it to fill AliITSgeom structure.
+ fclose(file);
+ printf("ready to read .det file %s\n",filtmp);
+ fITSgeom = new AliITSgeom(filtmp);
+ }else{
+ fITSgeom = 0;
+ // fill AliITSgeom structure from geant structure just filled above
+ }// end if(file)
+ delete [] filtmp;
+ }// end if(size>4)
+ printf("finished with euclid geometrys\n");
}
//_____________________________________________________________________________
-void AliITSv5::Init()
-{
- //
- // Initialise the ITS after it has been created
- //
- AliITS::Init();
+void AliITSv5::Init(){
+ //
+ // Initialise the ITS after it has been created
+ //
+ Int_t i,j,l;
+
+ fIdN = fId5N;
+ fIdName = new char*[fId5N];
+ fIdSens = new Int_t[fId5N];
+ for(i=0;i<fId5N;i++) {
+ l = strlen(fId5Name[i]);
+ fIdName[i] = new char[l+1];
+ for(j=0;j<l;j++) fIdName[i][j] = fId5Name[i][j];
+ fIdName[i][l] = '\0'; // Null terminate this string.
+ } // end for i
+
+ AliITS::Init();
}
//_____________________________________________________________________________
-void AliITSv5::StepManager()
-{
+void AliITSv5::StepManager(){
//
// Called for every step in the ITS
//
- Int_t copy, id;
- Int_t copy1,copy2;
- Float_t hits[7];
- Int_t vol[3];
+ Int_t copy, id;
+ Int_t copy1,copy2;
+ Float_t hits[8];
+ Int_t vol[4];
TLorentzVector position, momentum;
- TClonesArray &lhits = *fHits;
+ TClonesArray &lhits = *fHits;
//
- if(gMC->TrackCharge() && gMC->Edep()) {
- //
- // Only entering charged tracks
- if((id=gMC->CurrentVolID(copy))==fIdSens1) {
- vol[0]=1;
- id=gMC->CurrentVolOffID(0,copy); //detector copy in the ladder = 1<->4 (ITS1)
- vol[1]=copy;
- gMC->CurrentVolOffID(1,copy1); //ladder copy in the module = 1<->2 (I186)
- gMC->CurrentVolOffID(2,copy2); //module copy in the layer = 1<->10 (I132)
- vol[2]=copy1+(copy2-1)*2; //# of ladders in one module = 2
- } else if(id==fIdSens2) {
- vol[0]=2;
- id=gMC->CurrentVolOffID(0,copy); //detector copy in the ladder = 1<->4 (ITS2)
- vol[1]=copy;
- gMC->CurrentVolOffID(1,copy1); //ladder copy in the module = 1<->4 (I131)
- gMC->CurrentVolOffID(2,copy2); //module copy in the layer = 1<->10 (I132)
- vol[2]=copy1+(copy2-1)*4; //# of ladders in one module = 4
- } else if(id==fIdSens3) {
- vol[0]=3;
- id=gMC->CurrentVolOffID(1,copy); //detector copy in the ladder = 1<->5 (ITS3 is inside I314)
- vol[1]=copy;
- id=gMC->CurrentVolOffID(2,copy); //ladder copy in the layer = 1<->12 (I316)
- vol[2]=copy;
- } else if(id==fIdSens4) {
- vol[0]=4;
- id=gMC->CurrentVolOffID(1,copy); //detector copy in the ladder = 1<->8 (ITS4 is inside I414)
- vol[1]=copy;
- id=gMC->CurrentVolOffID(2,copy); //ladder copy in the layer = 1<->22 (I417)
- vol[2]=copy;
- } else if(id==fIdSens5) {
- vol[0]=5;
- id=gMC->CurrentVolOffID(1,copy); //detector copy in the ladder = 1<->23 (ITS5 is inside I562)
- vol[1]=copy;
- id=gMC->CurrentVolOffID(2,copy); //ladder copy in the layer = 1<->34 (I565)
- vol[2]=copy;
- } else if(id==fIdSens6) {
- vol[0]=6;
- id=gMC->CurrentVolOffID(1,copy); //detector copy in the ladder = 1<->26 (ITS6 is inside I566)
- vol[1]=copy;
- id=gMC->CurrentVolOffID(2,copy); //ladder copy in the layer = 1<->38 (I569)
- vol[2]=copy;
- } else return;
- gMC->TrackPosition(position);
- gMC->TrackMomentum(momentum);
- hits[0]=position[0];
- hits[1]=position[1];
- hits[2]=position[2];
- hits[3]=momentum[0];
- hits[4]=momentum[1];
- hits[5]=momentum[2];
- hits[6]=gMC->Edep();
- new(lhits[fNhits++]) AliITShit(fIshunt,gAlice->CurrentTrack(),vol,hits);
- }
+ // Track status
+ vol[3] = 0;
+ if(gMC->IsTrackInside()) vol[3] += 1;
+ if(gMC->IsTrackEntering()) vol[3] += 2;
+ if(gMC->IsTrackExiting()) vol[3] += 4;
+ if(gMC->IsTrackOut()) vol[3] += 8;
+ if(gMC->IsTrackDisappeared()) vol[3] += 16;
+ if(gMC->IsTrackStop()) vol[3] += 32;
+ if(gMC->IsTrackAlive()) vol[3] += 64;
+ //
+ // Fill hit structure.
+ if(!(gMC->TrackCharge())) return;
+ //
+ // Only entering charged tracks
+ if((id = gMC->CurrentVolID(copy)) == fIdSens[0]) {
+ vol[0] = 1;
+ id = gMC->CurrentVolOffID(0,copy);
+ //detector copy in the ladder = 1<->4 (ITS1)
+ vol[1] = copy;
+ gMC->CurrentVolOffID(1,copy1);
+ //ladder copy in the module = 1<->2 (I186)
+ gMC->CurrentVolOffID(2,copy2);
+ //module copy in the layer = 1<->10 (I132)
+ vol[2] = copy1+(copy2-1)*2;//# of ladders in one module = 2
+ } else if(id == fIdSens[1]){
+ vol[0] = 2;
+ id = gMC->CurrentVolOffID(0,copy);
+ //detector copy in the ladder = 1<->4 (ITS2)
+ vol[1] = copy;
+ gMC->CurrentVolOffID(1,copy1);
+ //ladder copy in the module = 1<->4 (I131)
+ gMC->CurrentVolOffID(2,copy2);
+ //module copy in the layer = 1<->10 (I132)
+ vol[2] = copy1+(copy2-1)*4;//# of ladders in one module = 4
+ } else if(id == fIdSens[2]){
+ vol[0] = 3;
+ id = gMC->CurrentVolOffID(1,copy);
+ //detector copy in the ladder = 1<->5 (ITS3 is inside I314)
+ vol[1] = copy;
+ id = gMC->CurrentVolOffID(2,copy);
+ //ladder copy in the layer = 1<->12 (I316)
+ vol[2] = copy;
+ } else if(id == fIdSens[3]){
+ vol[0] = 4;
+ id = gMC->CurrentVolOffID(1,copy);
+ //detector copy in the ladder = 1<->8 (ITS4 is inside I414)
+ vol[1] = copy;
+ id = gMC->CurrentVolOffID(2,copy);
+ //ladder copy in the layer = 1<->22 (I417)
+ vol[2] = copy;
+ }else if(id == fIdSens[4]){
+ vol[0] = 5;
+ id = gMC->CurrentVolOffID(1,copy);
+ //detector copy in the ladder = 1<->23 (ITS5 is inside I562)
+ vol[1] = copy;
+ id = gMC->CurrentVolOffID(2,copy);
+ //ladder copy in the layer = 1<->34 (I565)
+ vol[2] = copy;
+ }else if(id == fIdSens[5]){
+ vol[0] = 6;
+ id = gMC->CurrentVolOffID(1,copy);
+ //detector copy in the ladder = 1<->26 (ITS6 is inside I566)
+ vol[1] = copy;
+ id = gMC->CurrentVolOffID(2,copy);
+ //ladder copy in the layer = 1<->38 (I569)
+ vol[2] = copy;
+ } else {
+ return; // not an ITS volume?
+ } // end if/else if (gMC->CurentVolID(copy) == fIdSens[i])
+//
+ gMC->TrackPosition(position);
+ gMC->TrackMomentum(momentum);
+ hits[0]=position[0];
+ hits[1]=position[1];
+ hits[2]=position[2];
+ hits[3]=momentum[0];
+ hits[4]=momentum[1];
+ hits[5]=momentum[2];
+ hits[6]=gMC->Edep();
+ hits[7]=gMC->TrackTime();
+ // Fill hit structure with this new hit.
+ new(lhits[fNhits++]) AliITShit(fIshunt,gAlice->CurrentTrack(),vol,hits);
+ return;
}
+//____________________________________________________________________________
+void AliITSv5::Streamer(TBuffer &R__b)
+{
+ // Stream an object of class AliITSv5.
+
+ if (R__b.IsReading()) {
+ Version_t R__v = R__b.ReadVersion(); if (R__v) { }
+ AliITS::Streamer(R__b);
+ // This information does not need to be read. It is "hard wired"
+ // into this class via its creators.
+ //R__b >> fId5N;
+ //R__b.ReadArray(fId5Name);
+ } else {
+ R__b.WriteVersion(AliITSv5::IsA());
+ AliITS::Streamer(R__b);
+ // This information does not need to be saved. It is "hard wired"
+ // into this class via its creators.
+ //R__b << fId5N;
+ //R__b.WriteArray(fId5Name, __COUNTER__);
+ }
+}
+
#ifndef ITSv5_H
#define ITSv5_H
-/////////////////////////////////////////////////////////
-// Manager and hits classes for set: ITS version 4 //
-/////////////////////////////////////////////////////////
-
-#include "AliITS.h"
+////////////////////////////////////////////////////////////////////////
+// Manager and hits classes for ITS version 5
+////////////////////////////////////////////////////////////////////////
+
#include "TString.h"
-
-class AliITSv5 : public AliITS {
+#include "AliITS.h"
+#include "AliITSgeom.h"
+
+class AliITSv5 : public AliITS {
private:
+ Int_t fId5N; // The number of layers for geometry version 5
+ // The name of the layers as defined in the Geant tree.
+ char **fId5Name;
public:
- AliITSv5();
- AliITSv5(const char *name, const char *title);
- virtual ~AliITSv5() {}
- virtual void CreateGeometry();
- virtual void CreateMaterials();
- virtual void Init();
- virtual Int_t IsVersion() const {return 5;}
- virtual void StepManager();
+ AliITSv5();
+ AliITSv5(const char *name, const char *title);
+ virtual ~AliITSv5() {}
+ virtual void CreateGeometry();
+ virtual void CreateMaterials();
+ virtual void Init();
+ inline virtual Int_t IsVersion() const {return 5;}
+ virtual void StepManager();
- ClassDef(AliITSv5,1) //Hits manager for set:ITS version 4
+ ClassDef(AliITSv5,1) //Hits manager for ITS version 5
};
#endif
#pragma link off all classes;
#pragma link off all functions;
-#pragma link C++ class AliITS;
-#pragma link C++ class AliITSv0;
+#pragma link C++ class AliITS-;
#pragma link C++ class AliITSv1;
#pragma link C++ class AliITSv3;
-// Probably to be removed, this is the non-turbo version
-//#pragma link C++ class AliITSv4;
-#pragma link C++ class AliITSv5;
+#pragma link C++ class AliITSv5-;
#pragma link C++ class AliITShit;
#pragma link C++ class AliITSdigit;
+#pragma link C++ class AliITSgeom-;
+#pragma link C++ class AliITSgeomSPD;
+#pragma link C++ class AliITSgeomSDD;
+#pragma link C++ class AliITSgeomSSD;
+#pragma link C++ class AliITSmodule-;
+#pragma link C++ class AliITSmoduleSPD;
+#pragma link C++ class AliITSmoduleSDD;
+#pragma link C++ class AliITSmoduleSSD;
+#pragma link C++ class AliITSdigitSSD;
#endif
--- /dev/null
+/*
+// Some time it is nice to compile the code to find all of the typos.
+#include <stdio.h>
+#include <math.h>
+#include "TROOT.h"
+#include "TSystem.h"
+#include "TClassTable.h"
+#include "TFile.h"
+#include "AliITS.h"
+#include "TTree.h"
+#include "TClonesArray.h"
+#include "TArray.h"
+#include "TCanvas.h"
+#include "AliRun.h"
+#include "AliITSgeom.h"
+#include "TParticlet.h"
+
+extern TSystem *gSystem;
+extern TROOT *gROOT;
+extern TClassTable *gClassTable;
+extern AliRun *gAlice;
+*/
+
+Double_t dEtadZ(Double_t z,Double_t r){
+ Float_t a;
+
+ a = TMath::Sqrt(z*z+r*r);
+ if(a!=0.0) a = 1./a;
+ return(a);
+}
+
+Double_t PdEtadZ(Double_t *z,Double_t *r){
+ return(dEtadZ(*z,*r));
+}
+
+Double_t ZfromEtaR(Double_t eta,Double_t r){
+ Double_t z;
+
+ z = 2.0*TMath::ATan(TMath::Exp(-eta));
+ z = r/TMath::Tan(z);
+ return(z);
+}
+
+Double_t EtafromZr(Double_t z,Double_t r){
+ Double_t a,eta;
+
+ a = 0.5*TMath::ATan2(r,z); // Tan2(y,x) = y/x
+ eta = -TMath::Log(TMath::Abs(TMath::Tan(a)));
+ if(a<0.0) eta = -eta;
+ return (eta);
+}
+
+Double_t PEtafromZr(Double_t *z,Double_t *r){
+ return (EtafromZr(*z,*r));
+}
+
+Double_t Weight(Double_t *a,Double_t *b){
+ Double_t eta,z,Etap,rt,dEta,dEtap,weight,REtap;
+
+ eta = a[0];
+ Etap = a[1];
+ rt = b[0];
+ dEta = b[1];
+ dEtap = b[2];
+ REtap = b[3];
+ z = ZfromEtaR(eta,rt);
+ weight = TMath::Abs(dEtadZ(z,rt));
+ weight = weight*REtap/(rt*2.0*TMath::Pi()*dEta*dEtap);
+ return weight;
+}
+
+void ITShitOccupancy (const char *filename="galice.root",Int_t evNumber=0){
+/////////////////////////////////////////////////////////////////////////
+//
+// Written by Roberto Barbera
+// Modified by Bjorn S. Nilsen May 19 1999
+//
+// This macro is a small example of a ROOT macro
+// illustrating how to read the output of aliroot
+// and fill some histograms. The Occupancy values produce are only
+// approximate and are known to have problems. No warranty of any kind
+// may be give or assumed.
+//
+// Root > .L ITShitOccupancy.C//this loads the macro in memory
+// Root > ITShitOccupancy(); //by default process first event
+// Root > ITShitOccupancy("galiceA.root"); //process file galiceA.root
+// Root > ITShitOccupancy("galiceA.root",2);//process file galiceA.root
+// third event
+//
+// Root > .x ITShitOccupancy.C(); //by default process first event
+// Root > .x ITShitOccupancy.C("galiceA.root"); //process file galiceA.root
+// Root > .x ITShitOccupancy.C("galiceA.root",2);//process file
+// galiceA.root third event
+// The test figures for this macro are kept in
+// $ALICE_ROOT/ITS/figures/ITShitOccupancy.figures as a series of post-
+// script files and one ITShitOccupancy.root file. This is because ther
+// are so many figures produced.
+//
+////////////////////////////////////////////////////////////////////////
+//
+// The code computes the Occupancy of HITS in the different ITS detectors
+// as a function of z. This does not represent the true occupancy expected
+// in the ITS since there will be more than one hit per charge cluster in
+// the different detector of the ITS. To do a proper occupancy calculation
+// a full simulation of all of the detectors in the ITS will be needed. In
+// addition a proper background needs to be used.
+//
+// This code has been modified to be as compatible with the standard (May 26
+// 1999) version of the official released ITS code as possible. Functions
+// introduce in the unofficial release of the ITS code (March 199) have
+// been commented out and replaced by the variables defined in the ITShits
+// class. As soon as these functions are officially part of the aliroot
+// release. These functions should be used instead to maximise future
+// portability.
+//
+// As with all ITS software produced under the deadline of the ITS TDR, there
+// is no real guarantee that this code will function, produce meaning full
+// results, solve in any way any possible problem or question, or be supported
+// in any kind. Questions or comments can be addressed to
+// Nilsen@mps.ohio-state.edu (for as long as I am there) or
+// Roberto.Barbera@ct.infn.it. A response may never come.
+//
+// This exclamation should be copy written and thereby not used my any other
+// software writer, especially those writing code for ALICE. We expect
+// everyone else's code to work perfectly and do the job as advertised, either
+// explicitly, by word of mouth, or by any other mystical means.
+//
+////////////////////////////////////////////////////////////////////////
+// Dynamically link some shared libs
+ if (gClassTable->GetID("AliRun") < 0) {
+ gROOT->LoadMacro("loadlibs.C");
+ loadlibs();
+ } // end if gClassTable...
+//
+// Connect the Root Galice file containing Geometry, Kine and Hits
+ TFile *file = (TFile*)gROOT->GetListOfFiles()->FindObject(filename);
+ if (!file) file = new TFile(filename);
+ printf("Reading from root file %s\n",filename);
+//
+// Get AliRun object from file or create it if not on file
+ if (!gAlice) {
+ gAlice = (AliRun*)file->Get("gAlice");
+ if (gAlice) printf("AliRun object found on file\n");
+ if (!gAlice) gAlice = new AliRun("gAlice","Alice test program");
+ } // end if !gAlice
+//
+// Get pointers to Alice detectors and Hits containers
+ Int_t nparticles = gAlice->GetEvent(evNumber);
+ if (nparticles <= 0) return;
+ AliITS *ITS = gAlice->GetDetector("ITS");
+ if(!ITS) {printf("ITS detector not found. Exiting\n"); return;}
+ TClonesArray *Particles = gAlice->Particles();
+ TClonesArray *ITShits = ITS->Hits();
+ TTree *TH = gAlice->TreeH();
+ Int_t ntracks = TH->GetEntries();
+ AliITSgeom *gm = ITS->GetITSgeom();
+ Int_t Nlayers = gm->GetNlayers();
+//
+ printf("%d primary tracks and their secondary tracks read in\n",ntracks);
+//
+// Import the Kine and Hits Trees for the event evNumber in the file
+ Float_t x,y,z,mass,e,r,rt;
+ Float_t px,py,pz,pt;
+ Float_t destep;
+ Float_t theta,phi;
+ Float_t eta,etap;
+ Float_t dzeta,weight;
+ Int_t idpart;
+//
+ Float_t ztot[] = {33.52,// total length of layer 1
+ 33.52,// total length of layer 2
+ 46.10,// total length of layer 3
+ 60.77,// total length of layer 4
+ 90.42,// total length of layer 5
+ 101.95};// total length of layer 6
+ Float_t raprx[] = {4.0,7.0,14.9,23.8,39.1,43.6}; // aproximate layer radii
+//
+ Float_t totdet[]={256*256*4*20,//total number of channels layer 1 = 5242880
+ 256*256*4*40,//total number of channels layer 2 = 10485760
+ 2*256*256*6*14,//total number of channels layer 3 = 11010048
+ 2*256*256*8*22,//total number of channels layer 4 = 23068672
+ 768*23*34,//total number of channels layer 5 = 1201152
+ 768*26*38};//total number of channels layer 6 = 1517568
+//
+ Float_t clusize,clusize_z,clusize_rphi;
+//
+ Float_t threshold[]={8.0e-6,8.0e-6, // noise= 200 e- ; thr = 2000 e- ;
+ 3.0e-6,3.0e-6, // noise= 250 e- ; thr= 3 sigma noise
+ 6.0e-6,6.0e-6};// noise= 500 e- ; thr= 3 sigma noise
+//
+ Int_t nhitlayer[6];
+ Int_t ntrklayer[6];
+ Int_t layer,ladder,det;
+ Int_t nbytes = 0;
+ Int_t i,j,jj,hit,ipart,ipartold,iparent;
+ Int_t nhits;
+ Int_t sector,plane;
+ TParticle *particle,*pparticle;
+ AliITShit *itsHit;
+
+// Create histograms
+
+ Float_t etamin = -1.;
+ Float_t etamax = 1.;
+ Float_t ptmin = 0.;
+ Float_t ptmax = 3.;
+ Int_t nbin = 40;
+ Int_t nbinz = 200;
+ Float_t deta = (etamax-etamin)/nbin;
+ Float_t EtapMax=2.436246,EtapMin=-2.436246; // from Config.C file
+ TVector etabin(nbin+1);
+ TVector zbin(nbin+1);
+
+// Open a root file to save histograms in
+ char *Hfilename = "ITShitOccupancy.root";
+ TFile *Hfile = (TFile *)gROOT->GetListOfFiles()->FindObject(Hfilename);
+ if(Hfile) Hfile->Close();
+ Hfile = new TFile(Hfilename,"RECREATE","Histograms for ITS Occupancy");
+ printf("Writting histograms to root file %s\n",Hfilename);
+//
+ TH2F *hzetap[6];
+ TH1D *hzetap_z[6],*hzetap_etap[6];
+ TH2F *hzetapden[6];
+ TH1D *hzetapden_z[6],*hzetapden_etap[6];
+ TH2F *hEtaEtapden[6];
+ TH1D *hEtaEtapden_Eta[6],*hEtaEtapden_Etap[6];
+ TH2F *hEtaEtapdenWeight[6];
+ TH1D *hEtaEtapdenWeight_Eta[6];
+ TF2 *fweight;
+ TF1 *fdEtadZ,*fEta;
+ TH1F *hdEtadZ[6],*hEta[6];
+
+ { // "Book" histograms
+ char histid[7],htit[40];
+ for(i=0;i<Nlayers;i++){
+ sprintf(histid,"hzetap%1.1d",i+1);
+ sprintf(htit,"Hits for Layer %1.1d",i+1);
+ hzetap[i] = new TH2F(histid,htit,nbinz,-0.6*ztot[i],0.6*ztot[i],
+ 20,floor(EtapMin)-1.0,ceil(EtapMax)+1.0);
+ hzetap[i]->SetXTitle("Z (cm)");
+ hzetap[i]->SetYTitle("Beam particle pseudorapidity");
+ hzetap[i]->Sumw2();
+ //
+ sprintf(histid,"hzetapden%1.1d",i+1);
+ sprintf(htit,"Density of Hits for Layer %1.1d",i+1);
+ hzetapden[i] = new TH2F(histid,htit,nbinz,-0.6*ztot[i],0.6*ztot[i],
+ 20,floor(EtapMin)-1.0,ceil(EtapMax)+1.0);
+ hzetapden[i]->Sumw2();
+ hzetapden[i]->SetXTitle("Z (cm)");
+ hzetapden[i]->SetYTitle("Beam particle pseudorapidity");
+ nhitlayer[i] = 0.0;
+ ntrklayer[i] = 0.0;
+ //
+ sprintf(histid,"hEtaEtapden%1.1d",i+1);
+ sprintf(htit,"Hits for Layer %1.1d by Eta",i+1);
+ hEtaEtapden[i] = new TH2F(histid,htit,nbinz,
+ -EtafromZr(0.6*ztot[i],raprx[i]),
+ EtafromZr(0.6*ztot[i],raprx[i]),
+ 20,floor(EtapMin)-1.0,ceil(EtapMax)+1.0);
+ hEtaEtapden[i]->SetXTitle("Track Pseudorapidity");
+ hEtaEtapden[i]->SetYTitle("Beam particle pseudorapidity");
+ hEtaEtapden[i]->Sumw2();
+ } // end for i
+
+ sprintf(histid,"fweight");
+ fweight = new TF2(histid,Weight,-EtafromZr(0.6*ztot[0],raprx[0]),
+ EtafromZr(0.6*ztot[0],raprx[0]),
+ floor(EtapMin)-1.0,ceil(EtapMax)+1.0,4);
+ Double_t params[4];
+ sprintf(histid,"fdEtadZ");
+ fdEtadZ = new TF1(histid,PdEtadZ,floor(EtapMin)-1.0,
+ ceil(EtapMax)+1.0,1);
+ sprintf(histid,"fEta");
+ fEta = new TF1(histid,PEtafromZr,floor(EtapMin)-1.0,
+ ceil(EtapMax)+1.0,1);
+ for(i=0;i<Nlayers;i++){
+ params[0] = raprx[i];
+ params[1] = hEtaEtapden[i]->GetXaxis()->GetBinWidth(1);
+ params[2] = hEtaEtapden[i]->GetYaxis()->GetBinWidth(1);
+ params[3] = EtapMax-EtapMin;
+ fweight->SetParameters(params);
+ sprintf(histid,"hEtaEtapdenWeight%1.1d",i+1);
+ sprintf(htit,"Weight for Layer %1.1d by Eta",i+1);
+ hEtaEtapdenWeight[i] = new TH2F(histid,htit,nbinz,
+ -EtafromZr(0.6*ztot[i],raprx[i]),
+ EtafromZr(0.6*ztot[i],raprx[i]),
+ 20,floor(EtapMin)-1.0,ceil(EtapMax)+1.0);
+ hEtaEtapdenWeight[i]->SetXTitle("Track Pseudorapidity");
+ hEtaEtapdenWeight[i]->SetYTitle("Beam particle pseudorapidity");
+ hEtaEtapdenWeight[i]->Sumw2();
+ hEtaEtapdenWeight[i]->Eval(fweight);
+//
+ fdEtadZ->SetParameters(params);
+ sprintf(histid,"hdEtadZ%1.1d",i+1);
+ sprintf(htit,"dEtadZ(z) for Layer %1.1d",i+1);
+ hdEtadZ[i] = new TH1F(histid,htit,nbinz,
+ -0.6*ztot[i],0.6*ztot[i]);
+ hdEtadZ[i]->SetXTitle("Z (cm)");
+ hdEtadZ[i]->Sumw2();
+ hdEtadZ[i]->Eval(fdEtadZ);
+//
+ fEta->SetParameters(params);
+ sprintf(histid,"hEta%1.1d",i+1);
+ sprintf(htit,"Eta(z) for Layer %1.1d",i+1);
+ hEta[i] = new TH1F(histid,htit,nbinz,
+ -0.6*ztot[i],0.6*ztot[i]);
+ hEta[i]->SetXTitle("Z (cm)");
+ hEta[i]->Sumw2();
+ hEta[i]->Eval(fEta);
+ } // end for i
+
+ } // end "Book" histograms
+// Start loop on tracks in the hits container
+
+ Double_t xa[2],par[4];
+
+ for (Int_t track=0; track<ntracks;track++) {
+ gAlice->ResetHits();
+ nbytes += TH->GetEvent(track);
+ nhits = ITShits->GetEntriesFast();
+ for (hit=0;hit<nhits;hit++) {
+ itsHit = (AliITShit*)ITShits->UncheckedAt(hit);
+ destep = itsHit->GetIonization();
+ // With this new version, to be able to do proper detector
+ // simulations, the requirment that a "hit" leave some
+ // energy deposited has been removed.
+ if(destep<=0.0) continue; // skip hits without energy loss.
+ ipart = itsHit->fTrack;
+ particle = (TParticle*)Particles->UncheckedAt(ipart);
+ iparent = particle->GetFirstMother();
+ pparticle= (TParticle*)Particles->UncheckedAt(ntracks-track);
+ etap = TMath::ATan2(pparticle->Pt(),pparticle->Pz());
+ etap = -TMath::Log(TMath::Tan(0.5*etap));
+ itsHit->GetPositionG(x,y,z);
+ x -= pparticle->Vx(); // correct for primary vertex position
+ y -= pparticle->Vy(); // correct for primary vertex position
+ z -= pparticle->Vz(); // correct for primary vertex position
+ itsHit->GetMomentumG(px,py,pz);
+ itsHit->GetDetectorID(layer,ladder,det);
+ r = sqrt(x*x+y*y+z*z);
+ rt = sqrt(x*x+y*y);
+ theta = TMath::ACos(z/r)*180./TMath::Pi();
+ phi = TMath::ATan2(y,x); if(phi<0.0) phi += TMath::Pi();
+ eta = EtafromZr(z,rt);
+ pt = TMath::Sqrt(px*px+py*py);
+ if(ipart!=ipartold)ntrklayer[layer-1] += 1;
+ ipartold = ipart;
+ nhitlayer[layer-1] += 1;
+
+ switch (layer) {
+ // Calculate average cluster sizes
+ case 1:
+ clusize_rphi = 1.4;
+ if(TMath::Abs(eta)>=0.0 && TMath::Abs(eta)< 0.2) clusize_z=1.2;
+ if(TMath::Abs(eta)>=0.2 && TMath::Abs(eta)< 0.4) clusize_z=1.2;
+ if(TMath::Abs(eta)>=0.4 && TMath::Abs(eta)< 0.6) clusize_z=1.3;
+ if(TMath::Abs(eta)>=0.6 && TMath::Abs(eta)< 0.8) clusize_z=1.4;
+ if(TMath::Abs(eta)>=0.8 && TMath::Abs(eta)< 1.0) clusize_z=1.5;
+ clusize = clusize_z*clusize_rphi;
+ case 2:
+ clusize_rphi = 1.4;
+ if(TMath::Abs(eta)>=0.0 && TMath::Abs(eta)< 0.2) clusize_z=1.2;
+ if(TMath::Abs(eta)>=0.2 && TMath::Abs(eta)< 0.4) clusize_z=1.2;
+ if(TMath::Abs(eta)>=0.4 && TMath::Abs(eta)< 0.6) clusize_z=1.3;
+ if(TMath::Abs(eta)>=0.6 && TMath::Abs(eta)< 0.8) clusize_z=1.4;
+ if(TMath::Abs(eta)>=0.8 && TMath::Abs(eta)< 1.0) clusize_z=1.5;
+ clusize = clusize_z*clusize_rphi;
+ case 3:
+ clusize_rphi = 8.0;
+ clusize_z = 3.0;
+ clusize = clusize_z*clusize_rphi;
+ case 4:
+ clusize_rphi = 8.0;
+ clusize_z = 3.0;
+ clusize = clusize_z*clusize_rphi;
+ case 5:
+ clusize_z = 1.0;
+ if(pt>=0.0 && pt< 0.2) clusize_rphi=2.0;
+ if(pt>=0.2 && pt< 0.4) clusize_rphi=1.9;
+ if(pt>=0.4 && pt< 0.6) clusize_rphi=1.6;
+ if(pt>=0.6 && pt< 0.8) clusize_rphi=1.6;
+ if(pt>=0.8 && pt< 1.0) clusize_rphi=1.7;
+ if(pt>=1.0 && pt< 1.5) clusize_rphi=1.7;
+ if(pt>=1.5 && pt< 2.5) clusize_rphi=1.7;
+ if(pt>=2.5 ) clusize_rphi=1.7;
+ clusize = clusize_z*clusize_rphi;
+ case 6:
+ clusize_z = 1.0;
+ if(pt>=0.0 && pt< 0.2) clusize_rphi=2.0;
+ if(pt>=0.2 && pt< 0.4) clusize_rphi=1.9;
+ if(pt>=0.4 && pt< 0.6) clusize_rphi=1.6;
+ if(pt>=0.6 && pt< 0.8) clusize_rphi=1.6;
+ if(pt>=0.8 && pt< 1.0) clusize_rphi=1.7;
+ if(pt>=1.0 && pt< 1.5) clusize_rphi=1.7;
+ if(pt>=1.5 && pt< 2.5) clusize_rphi=1.7;
+ if(pt>=2.5 ) clusize_rphi=1.7;
+ clusize = clusize_z*clusize_rphi;
+ } // end switch layer
+// weightE = clusize*ztot[layer-1]/totdet[layer-1];
+ xa[0] = eta; xa[1] = etap;
+ par[0] = rt;
+ par[1] = hEtaEtapden[layer-1]->GetXaxis()->GetBinWidth(1);
+ par[2] = hEtaEtapden[layer-1]->GetYaxis()->GetBinWidth(1);
+ par[3] = EtapMax-EtapMin;
+ weight = Weight(xa,par);
+ hEtaEtapden[layer-1]->Fill(eta,etap,weight);
+ weight = 1.;
+ hzetap[layer-1]->Fill(z,etap,weight);
+ weight = par[3]/(rt*2.0*TMath::Pi()*
+ hzetapden[layer-1]->GetXaxis()->GetBinWidth(1)*
+ hzetapden[layer-1]->GetYaxis()->GetBinWidth(1));
+ hzetapden[layer-1]->Fill(z,etap,weight);
+ } // end for hit
+ } // end for track
+
+ for(i=0;i<Nlayers;i++)printf("No. of hits in layer %d = %d\n",i+1,nhitlayer[i]);
+ for(i=0;i<Nlayers;i++)printf("No. of tracks in layer %d = %d\n",i+1,ntrklayer[i]);
+
+//Create canvases, set the view ranges and show histograms
+
+ TCanvas *canvas = new TCanvas("canvas","ITShitOccupancy",1);
+
+ Bool_t printit = kTRUE;
+ char psfilename[40];
+ for(i=0;i<Nlayers;i++){
+ hzetap[i]->Draw("colz");
+ sprintf(psfilename,"ITShitOccupancy_%1.1d_z_etap.ps",i+1);
+ if(printit) canvas->Print(psfilename);
+ sprintf(psfilename,"hzetap_z%1.1d",i+1);
+ hzetap_z[i] = hzetap[i]->ProjectionX(psfilename,0,
+ hzetap[i]->GetNbinsY()+1,"E");
+ hzetap_z[i]->SetXTitle("Z (cm)");
+ hzetap_z[i]->SetYTitle("Number of Hits per cm");
+ sprintf(psfilename,"hzetap_etap%1.1d",i+1);
+ hzetap_etap[i] = hzetap[i]->ProjectionY(psfilename,0,
+ hzetap[i]->GetNbinsX()+1,"E");
+ hzetap_etap[i]->SetXTitle("Beam particle pseudorapidity");
+ hzetap_etap[i]->SetYTitle("Number of Hits");
+ hzetap_z[i]->Draw();
+ sprintf(psfilename,"ITShitOccupancy_%1.1d_z.ps",i+1);
+ if(printit) canvas->Print(psfilename);
+ hzetap_etap[i]->Draw();
+ sprintf(psfilename,"ITShitOccupancy_%1.1d_etap.ps",i+1);
+ if(printit) canvas->Print(psfilename);
+//
+ hzetapden[i]->Draw("colz");
+ sprintf(psfilename,"ITSHitDen_%1.1d_z_etap.ps",i+1);
+ if(printit) canvas->Print(psfilename);
+ sprintf(psfilename,"hzetapden_z%1.1d",i+1);
+ hzetapden_z[i] = hzetapden[i]->ProjectionX(psfilename,0,
+ hzetapden[i]->GetNbinsY()+1,"E");
+ hzetapden_z[i]->SetXTitle("Z (cm)");
+ hzetapden_z[i]->SetYTitle("Number of Hits (cm^-2)");
+ sprintf(psfilename,"hzetapden_etap%1.1d",i+1);
+ hzetapden_etap[i] = hzetapden[i]->ProjectionY(psfilename,0,
+ hzetapden[i]->GetNbinsX()+1,"E");
+ hzetapden_etap[i]->SetXTitle("Beam particle pseudorapidity");
+ hzetapden_etap[i]->SetYTitle("Number of Hits (cm^-2)");
+ hzetapden_z[i]->Draw();
+ sprintf(psfilename,"ITSHitDen_%1.1d_z.ps",i+1);
+ if(printit) canvas->Print(psfilename);
+ hzetapden_etap[i]->Draw();
+ sprintf(psfilename,"ITSHitDen_%1.1d_etap.ps",i+1);
+ if(printit) canvas->Print(psfilename);
+//
+ hEtaEtapden[i]->Draw("colz");
+ sprintf(psfilename,"ITShitDensity_%1.1d_Eta_Etap.ps",i+1);
+ if(printit) canvas->Print(psfilename);
+ sprintf(psfilename,"hEtaEtapden_Eta%1.1d",i+1);
+ hEtaEtapden_Eta[i] = hEtaEtapden[i]->ProjectionX(psfilename,0,
+ hEtaEtapden[i]->GetNbinsY()+1,"E");
+ hEtaEtapden_Eta[i]->SetXTitle("Pseudorapidity");
+ hEtaEtapden_Eta[i]->SetYTitle("Number of Hits (cm^-2)");
+ sprintf(psfilename,"hEtaEtapden_Etap%1.1d",i+1);
+ hEtaEtapden_Etap[i] = hEtaEtapden[i]->ProjectionY(psfilename,0,
+ hEtaEtapden[i]->GetNbinsX()+1,"E");
+ hEtaEtapden_Etap[i]->SetXTitle("Beam particle pseudorapidity");
+ hEtaEtapden_Etap[i]->SetYTitle("Number of Hits (cm^-2)");
+ hEtaEtapden_Eta[i]->Draw();
+ sprintf(psfilename,"ITShitDensity_%1.1d_Eta.ps",i+1);
+ if(printit) canvas->Print(psfilename);
+ hEtaEtapden_Etap[i]->Draw();
+ sprintf(psfilename,"ITShitDensity_%1.1d_Etap.ps",i+1);
+ if(printit) canvas->Print(psfilename);
+//
+ hEtaEtapdenWeight[i]->Draw("colz");
+ sprintf(psfilename,"ITShitDensityWeight_%1.1d_Eta_Etap.ps",i+1);
+ if(printit) canvas->Print(psfilename);
+ sprintf(psfilename,"hEtaEtapdenWeight_Eta%1.1d",i+1);
+ hEtaEtapdenWeight_Eta[i] =
+ hEtaEtapdenWeight[i]->ProjectionX(psfilename,
+ 0,hEtaEtapdenWeight[i]->GetNbinsY()+1,"E");
+ hEtaEtapdenWeight_Eta[i]->SetXTitle("Pseudorapidity");
+ hEtaEtapdenWeight_Eta[i]->SetYTitle("Weight (cm^-2)");
+ hEtaEtapdenWeight_Eta[i]->Draw();
+ sprintf(psfilename,"ITShitDensityWeight_%1.1d_Eta.ps",i+1);
+ if(printit) canvas->Print(psfilename);
+ } // end for i
+//
+ Hfile->Write();
+//
+ return;
+}
# C++ sources
-SRCS = AliITS.cxx AliITSv0.cxx AliITSv1.cxx AliITSv3.cxx AliITSv5.cxx
+SRCS = AliITS.cxx AliITSv1.cxx AliITSv3.cxx AliITSv5.cxx AliITSdigit.cxx AliITSgeom.cxx AliITSgeomSPD.cxx AliITSgeomSDD.cxx AliITSgeomSSD.cxx AliITSmodule.cxx AliITSmoduleSPD.cxx AliITSmoduleSDD.cxx AliITSmoduleSSD.cxx AliITSdigitSSD.cxx AliITShit.cxx
# Fortran sources
default: $(SLIBRARY)
+
$(LIBDIR)/libITS.$(SL): $(OBJS)
$(DICT): $(HDRS)
CHECKS = $(patsubst %.cxx,check/%.viol,$(SRCS))
check: $(CHECKS)
-
-
-
-
-
-
-
--- /dev/null
+//void ViewITS_v3()
+{
+ gMC->Gsatt("ITSV","seen",0);
+ gMC->Gsatt("IT12","seen",0);
+ gMC->Gsatt("ITS1","seen",0);
+ gMC->Gsatt("ITS2","seen",0);
+ gMC->Gsatt("IT34","seen",0);
+ gMC->Gsatt("ITS3","seen",0);
+ gMC->Gsatt("ITS4","seen",0);
+ gMC->Gsatt("IT56","seen",0);
+ gMC->Gsatt("ITS5","seen",0);
+ gMC->Gsatt("ITS6","seen",0);
+
+ gMC->Gsatt("IPV1","seen",0);
+ gMC->Gsatt("IPB1","seen",0);
+ gMC->Gsatt("ICH1","seen",0);
+ gMC->Gsatt("IBU1","seen",1);
+ gMC->Gsatt("IPV2","seen",0);
+ gMC->Gsatt("IPB2","seen",0);
+ gMC->Gsatt("ICH2","seen",0);
+ gMC->Gsatt("IBU2","seen",1);
+
+ gMC->Gsatt("SPIX","seen",1);
+ gMC->Gsatt("SARC","seen",0);
+ gMC->Gsatt("IDV1","seen",0);
+
+ gMC->Gsatt("IR11","seen",0);
+ gMC->Gsatt("IR12","seen",0);
+ gMC->Gsatt("IR13","seen",0);
+ gMC->Gsatt("IR14","seen",0);
+ gMC->Gsatt("IR15","seen",0);
+ gMC->Gsatt("IR16","seen",0);
+ gMC->Gsatt("IR17","seen",0);
+ gMC->Gsatt("IEL1","seen",1);
+ gMC->Gsatt("IEL2","seen",1);
+ gMC->Gsatt("IEL3","seen",1);
+ gMC->Gsatt("IEL4","seen",1);
+
+ gMC->Gsatt("IDV2","seen",0);
+ gMC->Gsatt("IR21","seen",1);
+ gMC->Gsatt("IR22","seen",1);
+ gMC->Gsatt("IR23","seen",1);
+ gMC->Gsatt("IR24","seen",1);
+ gMC->Gsatt("IR25","seen",1);
+ gMC->Gsatt("IR26","seen",1);
+ gMC->Gsatt("IR27","seen",1);
+
+ gMC->Gsatt("IDV3","seen",0);
+ gMC->Gsatt("IR31","seen",0);
+ gMC->Gsatt("IR32","seen",0);
+ gMC->Gsatt("IR33","seen",0);
+ gMC->Gsatt("IR34","seen",0);
+ gMC->Gsatt("IR35","seen",0);
+ gMC->Gsatt("IR36","seen",0);
+ gMC->Gsatt("IR37","seen",0);
+ gMC->Gsatt("IEL5","seen",1);
+ gMC->Gsatt("IEL6","seen",1);
+ gMC->Gsatt("IEL7","seen",1);
+ gMC->Gsatt("IEL8","seen",1);
+ gMC->Gsatt("IDV4","seen",0);
+ gMC->Gsatt("IR41","seen",1);
+ gMC->Gsatt("IR42","seen",1);
+ gMC->Gsatt("IR43","seen",1);
+ gMC->Gsatt("IR44","seen",1);
+ gMC->Gsatt("IR45","seen",1);
+ gMC->Gsatt("IR46","seen",1);
+ gMC->Gsatt("IR47","seen",1);
+
+ gMC->Gsatt("ISV1","seen",0);
+ gMC->Gsatt("SSV1","seen",0);
+ gMC->Gsatt("ELL5","seen",0);
+ gMC->Gsatt("SCH5","seen",1);
+ gMC->Gsatt("STB5","seen",1);
+ gMC->Gsatt("SWT5","seen",1);
+ gMC->Gsatt("SFR5","seen",1);
+ gMC->Gsatt("SCE5","seen",1);
+ gMC->Gsatt("EPL5","seen",0);
+ gMC->Gsatt("ECU5","seen",1);
+ gMC->Gsatt("EPX5","seen",0);
+ gMC->Gsatt("ESI5","seen",1);
+ gMC->Gsatt("ISV2","seen",0);
+ gMC->Gsatt("SSV2","seen",0);
+ gMC->Gsatt("ELL6","seen",0);
+ gMC->Gsatt("SCH6","seen",1);
+ gMC->Gsatt("STB6","seen",1);
+ gMC->Gsatt("SWT6","seen",0);
+ gMC->Gsatt("SFR6","seen",1);
+ gMC->Gsatt("SCE6","seen",1);
+ gMC->Gsatt("EPL6","seen",0);
+ gMC->Gsatt("ECU6","seen",1);
+ gMC->Gsatt("EPX6","seen",1);
+ gMC->Gsatt("ESI6","seen",1);
+ gMC->Gsatt("TR01","seen",1);
+ gMC->Gsatt("TR02","seen",1);
+ gMC->Gsatt("TR03","seen",1);
+ gMC->Gsatt("TR04","seen",1);
+ gMC->Gsatt("TR05","seen",1);
+ gMC->Gsatt("TR06","seen",1);
+ gMC->Gsatt("TR07","seen",1);
+ gMC->Gsatt("TR08","seen",1);
+ gMC->Gsatt("TR11","seen",1);
+ gMC->Gsatt("TR12","seen",1);
+ gMC->Gsatt("TR13","seen",1);
+ gMC->Gsatt("TR14","seen",1);
+ gMC->Gsatt("TR15","seen",1);
+ gMC->Gsatt("TR16","seen",1);
+ gMC->Gsatt("TR17","seen",1);
+ gMC->Gsatt("TR18","seen",1);
+ gMC->Gsatt("TR19","seen",1);
+ gMC->Gsatt("TR20","seen",1);
+ gMC->Gsatt("TR21","seen",1);
+ gMC->Gsatt("TR22","seen",1);
+ gMC->Gsatt("TR23","seen",1);
+ gMC->Gsatt("TR24","seen",1);
+ gMC->Gsatt("TR25","seen",1);
+ gMC->Gsatt("TR26","seen",1);
+ gMC->Gsatt("RCON","seen",0);
+ gMC->Gsatt("RTB1","seen",1);
+ gMC->Gsatt("RTB2","seen",1);
+ gMC->Gsatt("RP03","seen",1);
+ gMC->Gsatt("RP04","seen",1);
+ gMC->Gsatt("RP05","seen",1);
+ gMC->Gsatt("RP06","seen",1);
+ gMC->Gsatt("LCON","seen",0);
+ gMC->Gsatt("LTB1","seen",1);
+ gMC->Gsatt("LTB2","seen",1);
+ gMC->Gsatt("LP03","seen",1);
+ gMC->Gsatt("LP04","seen",1);
+ gMC->Gsatt("LP05","seen",1);
+ gMC->Gsatt("LP06","seen",1);
+}
// illustrating how to read the output of GALICE
// and fill some histograms.
//
-// Root > .L anal.C //this loads the macro in memory
-// Root > anal(); //by default process first event
-// Root > anal(2); //process third event
+// Root > .L analITS.C //this loads the macro in memory
+// Root > analITS(); //by default process first event
+// Root > analITS(2); //process third event
//Begin_Html
/*
-<img src="picts/anal.gif">
-*/
+<img src="figures/analITS_ref.gif">
+</pre>
+<br clear=left>
+<font size=+2 color=red>
+<p>A reference plot produced by analITS.C.
+</font>
+<pre>
+ */
//End_Html
/////////////////////////////////////////////////////////////////////////
// Dynamically link some shared libs
if (gClassTable->GetID("AliRun") < 0) {
- gSystem->Load("libGeant3Dummy.so"); // a dummy version of Geant3
- gSystem->Load("PHOS/libPHOSdummy.so"); // the standard Alice classes
- gSystem->Load("libgalice.so"); // the standard Alice classes
- }
+ gROOT->LoadMacro("loadlibs.C");
+ loadlibs();
+ } // end if gClassTable...
// Connect the Root Galice file containing Geometry, Kine and Hits
TFile *file = (TFile*)gROOT->GetListOfFiles()->FindObject("galice.root");
Int_t j,hit,ipart;
Int_t nhits;
Int_t sector,plane;
- GParticle *particle;
+ TParticle *particle;
AliTPChit *tpcHit;
AliITShit *itsHit;
// Create histograms
TH1F *hITSZ = new TH1F("hITSZ","Z of hits in ITS",100,-50.,50.);
TH1F *hITSR = new TH1F("hITSR","R of hits in ITS",100,0.,50.);
- TH1F *hITSDnum = new TH1F("hITSDnum","JLAY of hits in ITS",20, 0., 20.);
+ TH1F *hITSlayer= new TH1F("hITSlayer","JLAY of hits in ITS",6, 0., 6.);
TH1F *hITSTr = new TH1F("hITSTr","Track number for hits in ITS",100,0.,50000.);
// Start loop on tracks in the hits containers
nhits = ITShits->GetEntriesFast();
for (hit=0;hit<nhits;hit++) {
itsHit = (AliITShit*)ITShits->UncheckedAt(hit);
+ // With this new version, to be able to do proper detector
+ // simulations, the requirment that a "hit" leave some
+ // energy deposited has been removed.
+ if(itsHit->GetIonization()<=0.0) continue;
ipart = itsHit->fTrack;
- particle = (GParticle*)Particles->UncheckedAt(ipart);
- z = itsHit->fZ;
+ particle = (TParticle*)Particles->UncheckedAt(ipart);
+ z = itsHit->GetZG();
hITSZ->Fill(z);
- r = sqrt(itsHit->fX*itsHit->fX + itsHit->fY*itsHit->fY);
+ r = sqrt(itsHit->GetXG()*itsHit->GetXG() +
+ itsHit->GetYG()*itsHit->GetYG());
hITSR->Fill(r);
- hITSDnum->Fill(itsHit->fDnum);
+ hITSlayer->Fill((Float_t)itsHit->GetLayer());
hITSTr->Fill(itsHit->fTrack);
i++;
}
hITSR->Draw();
c1->cd(3);
gPad->SetFillColor(33);
- hITSDnum->SetFillColor(46);
- hITSDnum->Draw();
+ hITSlayer->SetFillColor(46);
+ hITSlayer->Draw();
c1->cd(4);
gPad->SetFillColor(33);
hITSTr->SetFillColor(46);
hITSTr->Draw();
- c1->Print("analITS.ps");
+ c1->Print("analITS.gif");
}
--- /dev/null
+void analITSgeom (const char *filename="galice.root",Int_t evNumber=0){
+/////////////////////////////////////////////////////////////////////////
+// This macro is a small example of a ROOT macro
+// illustrating how to read the output of GALICE
+// and fill some histograms.
+//
+// Root > .L analITSgeom.C //this loads the macro in memory
+// Root > analITSgeom(); //by default process first event
+// Root > analITgeomS(2); //process third event
+//Begin_Html
+/*
+<img src="figures/analITSgeom_ref.gif">
+</pre>
+<br clear=left>
+<font size=+2 color=red>
+<p>A reference plot produced by analITSgeom.C.
+</font>
+<pre>
+ */
+//End_Html
+/////////////////////////////////////////////////////////////////////////
+
+
+// Dynamically link some shared libs
+ if (gClassTable->GetID("AliRun") < 0) {
+ gROOT->LoadMacro("loadlibs.C");
+ loadlibs();
+ } // end if gClassTable...
+
+// Connect the Root Galice file containing Geometry, Kine and Hits
+ TFile *file = (TFile*)gROOT->GetListOfFiles()->FindObject(filename);
+ if (!file) file = new TFile(filename);
+
+// Get AliRun object from file or create it if not on file
+ if (!gAlice) {
+ gAlice = (AliRun*)file->Get("gAlice");
+ if (gAlice) printf("AliRun object found on file\n");
+ if (!gAlice) gAlice = new AliRun("gAlice","Alice test program");
+ }
+
+// Import the Kine and Hits Trees for the event evNumber in the file
+ Int_t nparticles = gAlice->GetEvent(evNumber);
+ if (nparticles <= 0) return;
+ Float_t x,y,z,mass,e,r,phi,flad;
+ Int_t nbytes = 0;
+ Int_t j,hit,ipart,lay;
+ Int_t nhits;
+ Int_t sector,plane;
+ TParticle *particle;
+ AliITShit *itsHit;
+
+// Get pointers to Alice detectors and Hits containers
+ AliDetector *ITS = gAlice->GetDetector("ITS");
+ if(!ITS) return;
+ TClonesArray *Particles = gAlice->Particles();
+ TClonesArray *ITShits = ITS->Hits();
+ AliITSgeom *gm = ((AliITS *)ITS)->GetITSgeom();
+
+ TTree *TH = gAlice->TreeH();
+ Int_t ntracks = TH->GetEntries();
+
+ // Create histograms
+ Float_t pi2 = 2.0*TMath::Pi();
+ Int_t Nlad = gm->GetNladders(1);
+ TH2F *hITS1 = new TH2F("hITS1","Ladder# vs. angle for Layer 1",
+ Nlad,0.5,(Float_t)Nlad+0.5,100,0.0,pi2);
+ Int_t Nlad = gm->GetNladders(2);
+ TH2F *hITS2 = new TH2F("hITS2","Ladder# vs. angle for Layer 2",
+ Nlad,0.5,(Float_t)Nlad+0.5,100,0.0,pi2);
+ Int_t Nlad = gm->GetNladders(3);
+ TH2F *hITS3 = new TH2F("hITS3","Ladder# vs. angle for Layer 3",
+ Nlad,0.5,(Float_t)Nlad+0.5,100,0.0,pi2);
+ Int_t Nlad = gm->GetNladders(4);
+ TH2F *hITS4 = new TH2F("hITS4","Ladder# vs. angle for Layer 4",
+ Nlad,0.5,(Float_t)Nlad+0.5,100,0.0,pi2);
+ Int_t Nlad = gm->GetNladders(5);
+ TH2F *hITS5 = new TH2F("hITS5","Ladder# vs. angle for Layer 5",
+ Nlad,0.5,(Float_t)Nlad+0.5,100,0.0,pi2);
+ Int_t Nlad = gm->GetNladders(6);
+ TH2F *hITS6 = new TH2F("hITS6","Ladder# vs. angle for Layer 6",
+ Nlad,0.5,(Float_t)Nlad+0.5,100,0.0,pi2);
+
+// Start loop on tracks in the hits containers
+ for (Int_t track=0; track<ntracks;track++) {
+ gAlice->ResetHits();
+ nbytes += TH->GetEvent(track);
+ Int_t i=0;
+ nhits = ITShits->GetEntriesFast();
+ for (hit=0;hit<nhits;hit++) {
+ itsHit = (AliITShit*)ITShits->UncheckedAt(hit);
+ // With this new version, to be able to do proper detector
+ // simulations, the requirment that a "hit" leave some
+ // energy deposited has been removed.
+ if(itsHit->GetIonization()<=0.0) continue;
+ phi = TMath::ATan2(itsHit->GetYG(),itsHit->GetXG());
+ if(phi<0.0) phi += pi2;
+ lay = itsHit->GetLayer();
+ flad = ((Float_t)itsHit->GetLadder()) + 0.5;
+ if(lay==1) hITS1->Fill(flad,phi,1.0);
+ if(lay==2) hITS2->Fill(flad,phi,1.0);
+ if(lay==3) hITS3->Fill(flad,phi,1.0);
+ if(lay==4) hITS4->Fill(flad,phi,1.0);
+ if(lay==5) hITS5->Fill(flad,phi,1.0);
+ if(lay==6) hITS6->Fill(flad,phi,1.0);
+ } // end for hit
+ } // end for track
+
+//Create a canvas, set the view range, show histograms
+ TCanvas *c1 = new TCanvas("c1"," ITS geometry test",400,10,600,700);
+ c1->Divide(2,3);
+ c1->cd(1);
+ hITS1->Draw();
+ c1->cd(2);
+ hITS2->Draw();
+ c1->cd(3);
+ hITS3->Draw();
+ c1->cd(4);
+ hITS4->Draw();
+ c1->cd(5);
+ hITS5->Draw();
+ c1->cd(6);
+ hITS6->Draw();
+ c1->Print("analITSgeom.gif");
+}