]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - RICH/AliRICHv0.cxx
TOF can't be created without FRAME error corrected
[u/mrichter/AliRoot.git] / RICH / AliRICHv0.cxx
index 67a6cabda71e85415e0bdf92b8f2032af593cb79..b4b9fd8ba6d139b5053ebb26d4c0e202b684619e 100644 (file)
-/**************************************************************************
- * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- *                                                                        *
- * Author: The ALICE Off-line Project.                                    *
- * Contributors are mentioned in the code where appropriate.              *
- *                                                                        *
- * Permission to use, copy, modify and distribute this software and its   *
- * documentation strictly for non-commercial purposes is hereby granted   *
- * without fee, provided that the above copyright notice appears in all   *
- * copies and that both the copyright notice and this permission notice   *
- * appear in the supporting documentation. The authors make no claims     *
- * about the suitability of this software for any purpose. It is          *
- * provided "as is" without express or implied warranty.                  *
- **************************************************************************/
+//**************************************************************************
+//  Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+//                                                                         *
+//  Author: The ALICE Off-line Project.                                    *
+//  Contributors are mentioned in the code where appropriate.              *
+//                                                                         *
+//  Permission to use, copy, modify and distribute this software and its   *
+//  documentation strictly for non-commercial purposes is hereby granted   *
+//  without fee, provided that the above copyright notice appears in all   *
+//  copies and that both the copyright notice and this permission notice   *
+//  appear in the supporting documentation. The authors make no claims     *
+//  about the suitability of this software for any purpose. It is          *
+//  provided "as is" without express or implied warranty.                  *
+//**************************************************************************
 
-/* $Id$ */
-
-
-/////////////////////////////////////////////////////////////
-//  Manager and hits classes for set: RICH default version //
-/////////////////////////////////////////////////////////////
-
-#include "Riostream.h"
-
-#include <TNode.h> 
-#include <TRandom.h> 
-#include <TTUBE.h>
-#include <TVirtualMC.h>
-
-#include "AliConst.h" 
-#include "AliPDG.h" 
-#include "AliRICHGeometry.h"
-#include "AliRICHResponse.h"
-#include "AliRICHResponseV0.h"
-#include "AliRICHSegmentationV0.h"
 #include "AliRICHv0.h"
-#include "AliRun.h"
+#include "AliRICHChamber.h" 
+#include <AliRun.h>
+#include <AliMC.h>
+#include <TVirtualMC.h>
+#include <TPDGCode.h>
+#include <TLorentzVector.h>
+#include <TMath.h>
 
 ClassImp(AliRICHv0)
-    
-//___________________________________________
-AliRICHv0::AliRICHv0(const char *name, const char *title)
-          :AliRICH(name,title)
+
+void AliRICHv0::StepManager()
 {
-//
-// Version 0
-// Default Segmentation, no hits
-    AliRICHSegmentationV0* segmentation = new AliRICHSegmentationV0;
-//
-//  Segmentation parameters
-    segmentation->SetPadSize(0.84,0.80);
-    segmentation->SetDAnod(0.84/2);
-//
-//  Geometry parameters
-    AliRICHGeometry* geometry = new AliRICHGeometry;
-    geometry->SetGapThickness(8);
-    geometry->SetProximityGapThickness(.4);
-    geometry->SetQuartzLength(131);
-    geometry->SetQuartzWidth(126.2);
-    geometry->SetQuartzThickness(.5);
-    geometry->SetOuterFreonLength(131);
-    geometry->SetOuterFreonWidth(40.3);
-    geometry->SetInnerFreonLength(131);
-    geometry->SetInnerFreonWidth(40.3);
-    geometry->SetFreonThickness(1.5);
-//
-//  Response parameters
-    AliRICHResponseV0*  response   = new AliRICHResponseV0;
-    response->SetSigmaIntegration(5.);
-    response->SetChargeSlope(27.);
-    response->SetChargeSpread(0.18, 0.18);
-    response->SetMaxAdc(4096);
-    response->SetAlphaFeedback(0.036);
-    response->SetEIonisation(26.e-9);
-    response->SetSqrtKx3(0.77459667);
-    response->SetKx2(0.962);
-    response->SetKx4(0.379);
-    response->SetSqrtKy3(0.77459667);
-    response->SetKy2(0.962);
-    response->SetKy4(0.379);
-    response->SetPitch(0.25);
-    response->SetWireSag(0);                     // 1->On, 0->Off
-    response->SetVoltage(2150);                  // Should only be 2000, 2050, 2100 or 2150
-//
-//    AliRICH *RICH = (AliRICH *) gAlice->GetDetector("RICH"); 
-    
-    fCkovNumber=0;
-    fFreonProd=0;
-    Int_t i=0;
-    
-    fChambers = new TObjArray(kNCH);
-    for (i=0; i<kNCH; i++) {
-      
-      //PH      (*fChambers)[i] = new AliRICHChamber();  
-      fChambers->AddAt(new AliRICHChamber(), i);  
-      
-    }
+//This StepManager is a provision for different test-learn activities on the current MC layer  
+  const char *sParticle;
+  switch(gMC->TrackPid()){
+    case kProton:
+      sParticle="proton";break;
+    case kNeutron:
+      sParticle="neutron";break;
+    case kGamma:
+      sParticle="gamma";break;
+    case kCerenkov:
+      sParticle="photon";break;
+    case kPi0:
+      sParticle="Pi0";break;  
+    case kElectron:
+      sParticle="electron";break;  
+    default:
+      sParticle="not known";break;
+  }
+
+  Info("","event=%i hunt=%i tid=%i pid=%i(%s) m=%f q=%3.1f dEdX=%9.3f",
+                            gMC->CurrentEvent(),
+                            fIshunt,
+                            gAlice->GetMCApp()->GetCurrentTrackNumber(),
+                            gMC->TrackPid(),
+                            sParticle,
+                            gMC->TrackMass(),
+                            gMC->TrackCharge(),
+                            gMC->Edep());
+  Info("","Flags:alive(%i) disap(%i) enter(%i) exit(%i) inside(%i) out(%i) stop(%i) new(%i)",
+                            gMC->IsTrackAlive(),
+                            gMC->IsTrackDisappeared(),
+                            gMC->IsTrackEntering(),
+                            gMC->IsTrackExiting(),
+                            gMC->IsTrackInside(),
+                            gMC->IsTrackOut(),
+                            gMC->IsTrackStop(),
+                            gMC->IsNewTrack());
+  Int_t copy0,copy1,copy2,copy3;
+  Int_t vid0=gMC->CurrentVolID(copy0);
+  Int_t vid1=gMC->CurrentVolOffID(1,copy1);
+  Int_t vid2=gMC->CurrentVolOffID(2,copy2);
+  Int_t vid3=gMC->CurrentVolOffID(3,copy3);
+  Info("","vid0=%i(%s)c%i vid1=%i(%s)c%i vid2=%i(%s)c%i vid3=%i(%s)c%i   %s-%s-%s-%s",
+                      vid0,gMC->VolName(vid0),copy0, 
+                      vid1,gMC->VolName(vid1),copy1, 
+                      vid2,gMC->VolName(vid2),copy2, 
+                      vid3,gMC->VolName(vid3),copy3, 
+                      gMC->CurrentVolName(),
+                      gMC->CurrentVolOffName(1),
+                      gMC->CurrentVolOffName(2),
+                      gMC->CurrentVolOffName(3));
   
-    for (i=0; i<kNCH; i++) {
-      SetGeometryModel(i,geometry);
-      SetSegmentationModel(i, segmentation);
-      SetResponseModel(i, response);
-    }
-}//name ctor
-//______________________________________________________________________________
-void AliRICHv0::StepManager()
-{//
-}//AliRICHv0::StepManager()
-//______________________________________________________________________________
+  Float_t a,z,den,rad,abs; a=z=den=rad=abs=kBad;
+  Int_t mid=gMC->CurrentMaterial(a,z,den,rad,abs);
+  Info("","mid=%i a=%7.2f z=%7.2f den=%7.2f rad=%7.2f abs=%7.2f",mid,a,z,den,rad,abs);
+  
+  TLorentzVector x4;
+  gMC->TrackPosition(x4);
+  Float_t glo[3],loc[3];
+  glo[0]=x4.X();glo[1]=x4.Y();glo[2]=x4.Z();  
+  gMC->Gmtod(glo,loc,1);
+  Info("","glo(%+8.3f,%+8.3f,%+8.3f) r=%8.3f theta=%8.3f phi=%8.3f",
+                      glo[0],glo[1],glo[2],x4.Rho(),x4.Theta()*TMath::RadToDeg(),x4.Phi()*TMath::RadToDeg());  
+  Info("","loc(%+8.3f,%+8.3f,%8.3f) by gMC->Gmtod()",         loc[0],loc[1],loc[2]);  
+  if(gMC->VolId("CSI ")==gMC->CurrentVolID(copy0)){
+    Int_t iChamber;
+    gMC->CurrentVolOffID(2,iChamber);
+    TVector3 x3=C(iChamber)->G2L(x4);
+    Info("","loc(%+8.3f,%+8.3f,%8.3f) by G2L",         x3.X(),x3.Y(),x3.Z());  
+    TVector2 x2=C(iChamber)->Glob2Loc(x4);
+    Info("","loc(%+8.3f,%+8.3f) by Global2Local",      x2.X(),x2.Y());  
+  }
+  Info("","end of current step\n");
+}//StepManager()
+//__________________________________________________________________________________________________