1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
16 /* $Id: AliAD.cxx $ */
18 ///////////////////////////////////////////////////////////////////////////
20 // AD (ALICE Diffractive) Detector //
22 // This class contains the base procedures for the AD detector //
23 // Default geometry of 2013: 16 modules //
24 // All comments should be sent to : //
27 ///////////////////////////////////////////////////////////////////////////
29 // --- Standard libraries ---
30 #include <Riostream.h>
32 // --- ROOT libraries ---
35 #include <TVirtualMC.h>
36 #include <TGeoManager.h>
37 #include <TGeoMatrix.h>
40 #include <TGeoShape.h>
43 #include <TGeoCompositeShape.h>
44 #include <TGeoGlobalMagField.h>
45 #include <TGeoMaterial.h>
46 #include <TGeoMedium.h>
47 #include <TGeoVolume.h>
49 #include <TClonesArray.h>
51 #include <TParticle.h>
56 // --- AliRoot header files ---
60 #include "AliADdigit.h"
70 //__________________________________________________________________
73 fADCLightYield(93.75),
74 fADCPhotoCathodeEfficiency(0.18),
75 fADALightYield(93.75),
76 fADAPhotoCathodeEfficiency(0.18)
79 // Default Constructor
83 //_____________________________________________________________________________
84 AliADv1::AliADv1(const char *name, const char *title) :
86 fADCLightYield(93.75),
87 fADCPhotoCathodeEfficiency(0.18),
88 fADALightYield(93.75),
89 fADAPhotoCathodeEfficiency(0.18)
91 // Standard constructor for AD Detector
93 AliModule* pipe = gAlice->GetModule("PIPE");
95 Error("Constructor","AD needs PIPE!!!\n");
98 fHits = new TClonesArray("AliADhit",400);
99 gAlice->GetMCApp()->AddHitList(fHits);
102 //_____________________________________________________________________________
105 // default destructor
107 //_____________________________________________________________________________
110 // Initialise L3 magnet after it has been built
112 if(AliLog::GetGlobalDebugLevel()>0) {
113 printf("\n%s: ",ClassName());
114 for(i=0;i<35;i++) printf("*");
115 printf(" ADv1_INIT ");
116 for(i=0;i<35;i++) printf("*");
117 printf("\n%s: ",ClassName());
118 for(i=0;i<80;i++) printf("*");
123 //_____________________________________________________________________________
124 void AliADv1::CreateGeometry()
127 // Create the geometry for the AD arrays
135 //_____________________________________________________________________________
136 void AliADv1::CreateAD()
139 // here we create AD: ADA & ADC
143 TGeoVolume *alice = gGeoManager->GetVolume("ALIC");
145 // Define the mother volume for AD
147 TGeoVolume *ad = new TGeoVolumeAssembly("AD");
151 TGeoMedium *medADASci = gGeoManager->GetMedium("AD_NE102"); // AD Scin.
152 TGeoMedium *medADALG = gGeoManager->GetMedium("AD_PMMA"); // lightGuide
153 TGeoMedium *medADAPMGlass = gGeoManager->GetMedium("AD_Glass"); // Glass for Aluminium simulation
154 TGeoMedium *medADAPMAlum = gGeoManager->GetMedium("AD_Alum"); // Aluminium
157 /// ADA Scintillator Pad Measures
158 const Double_t kADATriangleSide = 7.8; //
159 const Double_t kADACellSide = 20.0;
160 const Double_t kADACellThickness = 2.0; // Half thickness
161 const int kColorADA = kGreen;
164 // Creation of the Box's pad
166 new TGeoBBox( "ADAbox", kADACellSide/2.0-kADATriangleSide/2., kADACellSide/2.0, kADACellThickness );
167 const Double_t boxSide2 = kADACellSide/2.0-kADATriangleSide/2.;
168 new TGeoBBox( "ADAbox1", kADATriangleSide/2., boxSide2, kADACellThickness );
172 TGeoTranslation *trada2 = new TGeoTranslation( -kADACellSide/2.0, kADACellSide/2.0 - boxSide2, 0. );
173 trada2->SetName( "trada2" );
174 trada2->RegisterYourself();
176 TGeoArb8* sADAtriang = new TGeoArb8( "ADAtriang", kADACellThickness );
177 for ( int iz = 0; iz < 2; iz++ ) {
178 sADAtriang->SetVertex( 0+iz*4, kADACellSide/2.0, kADACellSide/2.0 );
179 sADAtriang->SetVertex( 1+iz*4, kADACellSide/2.0, (kADACellSide/2.0)-kADATriangleSide );
180 sADAtriang->SetVertex( 2+iz*4, kADACellSide/2.0, (kADACellSide/2.0)-kADATriangleSide );
181 sADAtriang->SetVertex( 3+iz*4, kADACellSide/2.0-kADATriangleSide, kADACellSide/2.0 );
183 TGeoTranslation *trada1 = new TGeoTranslation( -kADACellSide+kADATriangleSide/2. , -kADACellSide+kADATriangleSide, 0. );
184 trada1->SetName( "trada1" );
185 trada1->RegisterYourself();
187 TGeoCompositeShape *sADA1 = new TGeoCompositeShape ( "sADA1s1", "ADAbox+(ADAbox1:trada2)+(ADAtriang:trada1)" );
188 TGeoVolume *vADA1 = new TGeoVolume( "ADApad", sADA1, medADASci );
189 vADA1->SetLineColor( kColorADA );
192 Double_t kADALGThickness = 2.0; // Half thickness
193 Double_t kADALGSideScint = 20.0;
194 Double_t kADALGHeigth = TMath::Sqrt( kADALGSideScint*kADALGSideScint - (10.5 * 10.5) );
195 Double_t kADALGSideCoupling = 3.0;
196 const int kColorADALG = kYellow;
199 TGeoTrd2* sADALGtriang = new TGeoTrd2( kADALGThickness, kADALGThickness, kADALGSideScint/2., kADALGSideCoupling/2., kADALGHeigth/2.0);
200 TGeoVolume *vADALGtriang = new TGeoVolume( "ADALG", sADALGtriang, medADALG );
201 vADALGtriang->SetLineColor( kColorADALG );
204 Double_t kADALGCoupling = 5.0;
205 TGeoTube* sADACouplTube = new TGeoTube( "ADACouplTube", 0, 1.4, kADALGCoupling/2. );
206 TGeoVolume * vADACoupling = new TGeoVolume( "ADACoupling", sADACouplTube, medADALG );
207 vADACoupling->SetLineColor( kColorADALG );
209 TGeoVolume * vADALG1 = new TGeoVolumeAssembly( "ADALG" );
210 vADALG1->AddNode( vADALGtriang, 1 );
211 vADALG1->AddNode( vADACoupling, 1, new TGeoTranslation(0., 0., kADALGHeigth/2.+kADALGCoupling/2.) );
212 vADALG1->SetLineColor( kColorADALG );
214 /// PMT Hamamatsu R5946
215 Double_t kADAPMR1 = 1.95; // 3.9 cm diameter
216 Double_t kADAPMR2 = 2.15; // + 2 mm?? aluminium case
217 Double_t kADAPMlength = 6.4; // 5 cm PMT + 1.4 socket
218 const int kColorPMG = kWhite;
219 const int kColorPMA = kGray;
221 TGeoTube *sADAPMg1 = new TGeoTube( "sADAPMg", 0., kADAPMR1, kADAPMlength/2. );
222 TGeoVolume *vADAPMg1 = new TGeoVolume( "ADAPMg", sADAPMg1, medADAPMGlass );
223 vADAPMg1->SetLineColor( kColorPMG );
224 TGeoTube *sADAPMa1 = new TGeoTube( "ADAPMa", kADAPMR1, kADAPMR2, kADAPMlength/2. );
225 TGeoVolume *vADAPMa1 = new TGeoVolume( "ADAPMa", sADAPMa1, medADAPMAlum );
226 vADAPMa1->SetLineColor( kColorPMA );
227 TGeoVolume *vADAPM1 = new TGeoVolumeAssembly("ADAPM");
228 vADAPM1->AddNode( vADAPMg1, 1 );
229 vADAPM1->AddNode( vADAPMa1, 1 );
231 /// Sector (Assembly: Scintillator Pad + Light guide + PM )
232 TGeoVolume *secADA = new TGeoVolumeAssembly( "ADAsec" );
234 secADA->AddNode( vADA1, 1, new TGeoTranslation( kADACellSide/2.0+kADATriangleSide/2. + 0.05, kADACellSide/2.0 + 0.05, 0. ) );
236 TGeoCombiTrans *transrot = new TGeoCombiTrans( kADACellSide + kADALGHeigth/2.0 + 0.05, kADALGSideScint/2.0 + 0.05, 0.,
237 new TGeoRotation("rot",90.,90.,90.) );
238 secADA->AddNode( vADALG1, 1, transrot );
240 transrot = new TGeoCombiTrans( kADACellSide + kADALGHeigth + kADALGCoupling + kADAPMlength/2. + 0.05, kADACellSide/2.0 + 0.05, 0,
241 new TGeoRotation("rot",90.,90.,0.) );
242 secADA->AddNode(vADAPM1, 1, transrot);
244 // TODO: Add mechanical support
246 /// Assembling ADA adding 4 sectors // Sectors
247 TGeoVolume *vADAarray = new TGeoVolumeAssembly( "ADA" ); // ^ y
248 vADAarray->AddNode( secADA, 1 ); // |
249 vADAarray->AddNode( secADA, 2, new TGeoRotation("rot",0. , 180.,0.) ); // 4 | 1
250 vADAarray->AddNode( secADA, 3, new TGeoRotation("rot",180., 0., 0.) ); // ---------------> x
251 vADAarray->AddNode( secADA, 4, new TGeoRotation("rot",180., 180.,0.) ); // 3 | 2
252 TGeoRotation *rotADA90 = new TGeoRotation("adarot",90,0,0);
253 // here I add ADA to AD volume
254 const Float_t kPosADA = 1700.0;
255 ad->AddNode(vADAarray,1, new TGeoCombiTrans("ada",0,0,kPosADA,rotADA90)); // |
257 if (GetADAToInstalled())
259 const Float_t kPosADA2 = 1695.0;
260 ad->AddNode(vADAarray,2, new TGeoCombiTrans("ada",0,0,kPosADA2,rotADA90));
265 // Get Medium for ADC (in principle is the same as ADA, but I keep the previous variables)
267 TGeoMedium *medADCSci = gGeoManager->GetMedium("AD_NE102");
268 TGeoMedium *medADCLG = gGeoManager->GetMedium("AD_PMMA");
269 TGeoMedium *medADCPMGlass = gGeoManager->GetMedium("AD_Glass");
270 TGeoMedium *medADCPMAlum = gGeoManager->GetMedium("AD_Alum");
272 /// Creation of assembly of one ADC sector
274 /// ADC Scintillator Pad
275 const Double_t kADCCellSide = 30.;
276 const Double_t kADCCellThickness = 4.0;
277 const int kColorADC = kGreen;
279 new TGeoBBox( "ADCbox0", kADCCellSide/4.0, kADCCellSide/2.0, kADCCellThickness/2.0 );
280 new TGeoBBox( "ADCbox1", kADCCellSide/4.0, kADCCellSide/4.0, kADCCellThickness/2.0 );
281 new TGeoBBox( "ADCbox2", 2.5, 5.5, kADCCellThickness/2.0 );
282 TGeoTranslation *tradd1 = new TGeoTranslation( -kADCCellSide/2.0, kADCCellSide/4.0, 0. );
283 TGeoTranslation *tradd2 = new TGeoTranslation( -kADCCellSide/4.0 - 2.5, -kADCCellSide/2.0 + 5.5 , 0. );
284 tradd1->SetName( "tradd1" );
285 tradd2->SetName( "tradd2" );
286 tradd1->RegisterYourself();
287 tradd2->RegisterYourself();
288 TGeoCompositeShape *sADC1 = new TGeoCompositeShape ( "sADCpad", "ADCbox0+(ADCbox1:tradd1)+(ADCbox2:tradd2)" );
289 TGeoVolume *vADC = new TGeoVolume( "ADCpad", sADC1, medADCSci );
290 vADC->SetLineColor( kColorADC );
293 const Double_t kADCLGThickness = 4.0;
294 const Double_t kADCLGHeigth = 28.95; // Dist from scint to coupling
295 const Double_t kADCLGSideScint = kADCCellSide; // 30.0
296 const Double_t kADCLGSideCoupling = 4.0;
297 const int kColorADCLG = kYellow;
300 TGeoTrd2* sADCLGtriang = new TGeoTrd2( kADCLGThickness/2., kADCLGThickness/2., kADCLGSideScint/2., kADCLGSideCoupling/2., kADCLGHeigth/2.0);
301 TGeoVolume *vADCLGtriang = new TGeoVolume( "ADCLG", sADCLGtriang, medADCLG );
302 vADCLGtriang->SetLineColor( kColorADCLG );
305 Double_t kADCLGCoupling = 10.0; // Total lenght
306 new TGeoCone( "ADCCouplCone", kADCLGCoupling/4., 0, kADCLGSideCoupling/TMath::Sqrt(2.), 0, 1.4 );
307 new TGeoBBox( "ADCCouplBox", kADCLGSideCoupling/2., kADCLGSideCoupling/2., kADCLGCoupling/4. );
308 new TGeoTube( "ADCCouplTube", 0, 1.4, kADCLGCoupling/4. );
309 TGeoTranslation *tradd3 = new TGeoTranslation(0, 0, kADCLGCoupling/2. );
310 tradd3->SetName( "tradd3" );
311 tradd3->RegisterYourself();
313 TGeoCompositeShape * sADCCoupling = new TGeoCompositeShape ( "sADCCoupling", "ADCCouplBox * ADCCouplCone + (ADCCouplTube:tradd3)" );
314 TGeoVolume * vADCCoupling = new TGeoVolume( "ADCCoupling", sADCCoupling, medADCLG );
315 vADCCoupling->SetLineColor( kColorADCLG );
317 TGeoVolume * vADCLG = new TGeoVolumeAssembly( "ADCLG" );
318 vADCLG->AddNode( vADCLGtriang, 1 );
319 vADCLG->AddNode( vADCCoupling, 1, new TGeoTranslation(0., 0., kADCLGHeigth/2.+kADCLGCoupling/4.) );
320 vADCLG->SetLineColor( kColorADCLG );
322 /// PM Hamamatsu R5946
323 const Double_t kADCPMR1 = 1.95; // 3.9 cm diameter
324 const Double_t kADCPMR2 = 2.15; // + 2 mm?? aluminium case
325 const Double_t kADCPMlength = 6.4; // 5 cm PMT + 1.4 socket
326 //const int kColorPMG = kWhite;
327 ////const int kColorPMA = kGray;
329 TGeoTube *sADCPMg = new TGeoTube( "sADCPMg", 0., kADCPMR1, kADCPMlength/2. );
330 TGeoVolume *vADCPMg = new TGeoVolume( "ADCPMg", sADCPMg, medADCPMGlass );
331 vADCPMg->SetLineColor(kColorPMG);
332 TGeoTube *sADCPMa = new TGeoTube( "ADCPMa", kADCPMR1, kADCPMR2, kADCPMlength/2. );
333 TGeoVolume *vADCPMa = new TGeoVolume( "ADCPMa", sADCPMa, medADCPMAlum );
334 vADCPMa->SetLineColor( kColorPMA );
335 TGeoVolume *vADCPM = new TGeoVolumeAssembly( "ADCPM" );
336 vADCPM->AddNode( vADCPMg, 1 );
337 vADCPM->AddNode( vADCPMa, 1 );
339 /// Sector (Asembly: Scintillator Pad + Light guide + PM )
340 TGeoVolume *secADC = new TGeoVolumeAssembly("ADCsec");
342 TGeoCombiTrans *transrot1 = new TGeoCombiTrans( 3*kADCCellSide/4.0, kADCCellSide/2.0, 0., new TGeoRotation("rot",0.,0.,0.) );
343 secADC->AddNode( vADC, 1, transrot1 );
345 transrot1 = new TGeoCombiTrans( kADCCellSide + kADCLGHeigth/2.0, kADCLGSideScint/2.0, 0., new TGeoRotation("rot",90.,90.,90.) );
346 secADC->AddNode( vADCLG, 1, transrot1 );
348 transrot1 = new TGeoCombiTrans( kADCCellSide + kADCLGHeigth + kADCLGCoupling + kADCPMlength/2., kADCCellSide/2.0, 0, new TGeoRotation("rot",90.,90.,0.) );
349 secADC->AddNode( vADCPM, 1, transrot1 );
351 // TODO: Add mechanical support
353 /// Assembling ADC adding the 4 sectors // Sectors
354 TGeoVolume *vADCarray = new TGeoVolumeAssembly("ADC"); // ^ y
355 vADCarray->AddNode( secADC, 1 ); // |
356 vADCarray->AddNode( secADC, 2, new TGeoRotation("rot", 0. , 180., 0.) ); // 4 | 1
357 vADCarray->AddNode( secADC, 3, new TGeoRotation("rot", 180., 0., 0.) ); // ---------------> x
358 vADCarray->AddNode( secADC, 4, new TGeoRotation("rot", 180., 180., 0.) ); // 3 | 2
360 // here I add ADC to AD volume
362 //const Float_t kPosADC = -1902.75; // -1902.75 (with 4cm thick) puts the ADC just next to the YSAA3_CC_BLOCK
363 const Float_t kPosADC = -1900.0;
364 ad->AddNode(vADCarray,3,new TGeoTranslation(0,0,kPosADC));
366 if (GetADCToInstalled())
368 const Float_t kPosADC2 = -1895.0;
369 ad->AddNode(vADCarray,4,new TGeoTranslation(0,0,kPosADC2));
372 // at the end, I add "AD" volume into ALICE
374 alice->AddNode(ad,1);
377 //_____________________________________________________________________________
378 void AliADv1::AddAlignableVolumes() const
381 // Create entries for alignable volumes associating the symbolic volume
382 // name with the corresponding volume path. Needs to be syncronized with
383 // eventual changes in the geometry.
389 TString volpath1 = "/ALIC_1/AD_1/ADC_3";
390 TString volpath2 = "/ALIC_1/AD_1/ADC_4";
391 TString volpath3 = "/ALIC_1/AD_1/ADA_1";
392 TString volpath4 = "/ALIC_1/AD_1/ADA_2";
394 TString symname1 = "AD/ADC3";
395 TString symname2 = "AD/ADC4";
396 TString symname3 = "AD/ADA1";
397 TString symname4 = "AD/ADA2";
399 if ( !gGeoManager->SetAlignableEntry(symname1.Data(), volpath1.Data()) )
400 AliFatal(Form( "Alignable entry %s not created. Volume path %s not valid", symname1.Data(), volpath1.Data()) );
401 if ( GetADCToInstalled() && !gGeoManager->SetAlignableEntry(symname2.Data(), volpath2.Data()) )
402 AliFatal(Form( "Alignable entry %s not created. Volume path %s not valid", symname2.Data(), volpath2.Data()) );
403 if ( !gGeoManager->SetAlignableEntry(symname3.Data(), volpath3.Data()) )
404 AliFatal(Form( "Alignable entry %s not created. Volume path %s not valid", symname3.Data(), volpath3.Data()) );
405 if ( GetADAToInstalled() && !gGeoManager->SetAlignableEntry(symname4.Data(), volpath4.Data()) )
406 AliFatal(Form("Alignable entry %s not created. Volume path %s not valid", symname4.Data(), volpath4.Data()) );
411 //_____________________________________________________________________________
412 void AliADv1::StepManager()
416 // Routine called at every step in the AD
419 // ADA and ADC static Variables //
420 //static Int_t numStep_ad = 0; //
421 // static Int_t vol_ad[2]; //
423 /////////////////////////////////////////////////////////////////////////
425 /////////////////////////////////////////////////////////////////////////
428 // Get sensitive volumes id (scintillator pads)
429 static Int_t idADA = gMC->VolId( "ADApad" );
430 static Int_t idADC = gMC->VolId( "ADCpad" );
432 // We keep only charged tracks :
433 // if ( !gMC->TrackCharge() || !gMC->IsTrackAlive() ) return;
434 // We keep charged and non-charged tracks :
435 if ( !gMC->IsTrackAlive() ) return;
438 Int_t current_volid = gMC->CurrentVolID( copy );
440 // check is the track is in a sensitive volume
441 if( current_volid != idADA && current_volid != idADC ) {
442 return; // not in the sensitive volume
445 // First read the position, otherwise weird reults! //ecv
448 gMC->TrackPosition( s[0], s[1], s[2] );
449 for ( Int_t j=0; j<3; j++ ) x[j] = s[j];
451 // Set detectro type: ADA or ADC
452 Int_t detType = (current_volid == idADA ) ? 0 : 1;
454 // Get sector copy (1,2,3,4) ( 1 level up from pad )
456 gMC->CurrentVolOffID( 1, sect );
458 // Get Detector copy (1,2) ( 2 levels up from pad )
460 gMC->CurrentVolOffID( 2, detc );
467 Int_t sectorNumber_AD = detType*20 + detc*10 + sect;
469 Double_t lightYield_ad;
470 Double_t photoCathodeEfficiency;
473 lightYield_ad = fADCLightYield;
474 photoCathodeEfficiency = fADCPhotoCathodeEfficiency;
476 lightYield_ad = fADALightYield;
477 photoCathodeEfficiency = fADAPhotoCathodeEfficiency;
480 Float_t destep_ad = gMC->Edep();
481 Float_t step_ad = gMC->TrackStep();
482 Int_t nPhotonsInStep_ad = Int_t( destep_ad / (lightYield_ad * 1e-9) );
483 nPhotonsInStep_ad = gRandom->Poisson( nPhotonsInStep_ad );
485 static Float_t eloss_ad = 0.;
486 static Float_t tlength_ad = 0.;
487 static Int_t nPhotons_ad = 0;
488 static Float_t hits_ad[11];
489 static Int_t vol_ad[5];
491 eloss_ad += destep_ad;
492 tlength_ad += step_ad;
494 if ( gMC->IsTrackEntering() ) {
495 nPhotons_ad = nPhotonsInStep_ad;
497 gMC->TrackMomentum( p[0], p[1], p[2], p[3] );
498 Float_t pt = TMath::Sqrt( p[0]*p[0] + p[1]*p[1] + p[2]*p[2] );
499 TParticle *par = gAlice->GetMCApp()->Particle(gAlice->GetMCApp()->GetCurrentTrackNumber());
500 Int_t imo = par->GetFirstMother();
503 TParticle * pmot = gAlice->GetMCApp()->Particle(imo);
504 pdgMo = pmot->GetPdgCode();
507 // Set integer values
508 vol_ad[0] = par->GetStatusCode(); // secondary flag //ecv
509 vol_ad[1] = par->GetPdgCode(); // PDG code
510 vol_ad[2] = pdgMo; // PDG of the mother
512 hits_ad[0] = x[0]; // X
513 hits_ad[1] = x[1]; // Y
514 hits_ad[2] = x[2]; // Z
515 hits_ad[3] = p[3]; // kinetic energy of the entering particle
516 hits_ad[4] = pt; // Pt
517 hits_ad[5] = p[0]; // Px
518 hits_ad[6] = p[1]; // Py
519 hits_ad[7] = p[2]; // Pz
520 hits_ad[8] = 1.0e09*gMC->TrackTime(); // in ns!
525 return; // without return, we count 2 times nPhotonsInStep_ad !!!???
528 nPhotons_ad += nPhotonsInStep_ad;
530 if( gMC->IsTrackExiting() || gMC->IsTrackStop() || gMC->IsTrackDisappeared() ) {
532 // Set integer values
533 vol_ad[3] = nPhotons_ad;
534 // brutal correction for ADA_1
535 if (sectorNumber_AD==11) sectorNumber_AD=0;
536 if (sectorNumber_AD==12) sectorNumber_AD=1;
537 if (sectorNumber_AD==13) sectorNumber_AD=2;
538 if (sectorNumber_AD==14) sectorNumber_AD=3;
541 if (sectorNumber_AD==21) sectorNumber_AD=4;
542 if (sectorNumber_AD==22) sectorNumber_AD=5;
543 if (sectorNumber_AD==23) sectorNumber_AD=6;
544 if (sectorNumber_AD==24) sectorNumber_AD=7;
546 // brutal correction for ADC_3
547 if (sectorNumber_AD==51) sectorNumber_AD=8;
548 if (sectorNumber_AD==52) sectorNumber_AD=9;
549 if (sectorNumber_AD==53) sectorNumber_AD=10;
550 if (sectorNumber_AD==54) sectorNumber_AD=11;
553 if (sectorNumber_AD==61) sectorNumber_AD=12;
554 if (sectorNumber_AD==62) sectorNumber_AD=13;
555 if (sectorNumber_AD==63) sectorNumber_AD=14;
556 if (sectorNumber_AD==64) sectorNumber_AD=15;
559 vol_ad[4] = sectorNumber_AD; // sector number (scintillator ID)
561 hits_ad[9] = tlength_ad; // track lenght inside ADC or ADA
562 hits_ad[10] = eloss_ad; // energy loss
563 Int_t track = gAlice->GetMCApp()->GetCurrentTrackNumber();
564 AddHit( track, vol_ad, hits_ad ); // <-- this is in AliAD.cxx
570 // Do we need track reference ????
571 // if( gMC->IsTrackEntering() || gMC->IsTrackExiting() ) {
572 // AddTrackReference(gAlice->GetMCApp()->GetCurrentTrackNumber(), 49);
575 //_________________________________________________________
576 void AliADv1::AddHit(Int_t track, Int_t *vol, Float_t *hits)
578 TClonesArray &lhits = *fHits;
579 new(lhits[fNhits++]) AliADhit(fIshunt,track,vol,hits);
581 //_________________________________________________________
582 void AliADv1::MakeBranch(Option_t *option)
585 // Create branches in the current tree
586 TString branchname(Form("%s",GetName()));
587 AliDebug(2,Form("fBufferSize = %d",fBufferSize));
588 const char *cH = strstr(option,"H");
589 if (fHits && fLoader->TreeH() && cH)
591 fLoader->TreeH()->Branch(branchname.Data(),&fHits,fBufferSize);
592 AliDebug(2,Form("Making Branch %s for hits",branchname.Data()));
594 const char *cD = strstr(option,"D");
595 if (fDigits && fLoader->TreeD() && cD)
597 fLoader->TreeD()->Branch(branchname.Data(),&fDigits, fBufferSize);
598 AliDebug(2,Form("Making Branch %s for digits",branchname.Data()));