From 37e5988f77ba1eee210bf26311ca9516858eb371 Mon Sep 17 00:00:00 2001 From: morsch Date: Sat, 9 Jun 2007 13:43:16 +0000 Subject: [PATCH] Random rays in eta phi for lego plot. --- STEER/AliLegoGeneratorEtaR.cxx | 78 ++++++++++++++++++++++++++++++++++ STEER/AliLegoGeneratorEtaR.h | 36 ++++++++++++++++ STEER/STEERLinkDef.h | 1 + STEER/libSTEER.pkg | 2 +- 4 files changed, 116 insertions(+), 1 deletion(-) create mode 100644 STEER/AliLegoGeneratorEtaR.cxx create mode 100644 STEER/AliLegoGeneratorEtaR.h diff --git a/STEER/AliLegoGeneratorEtaR.cxx b/STEER/AliLegoGeneratorEtaR.cxx new file mode 100644 index 00000000000..1e6a614e320 --- /dev/null +++ b/STEER/AliLegoGeneratorEtaR.cxx @@ -0,0 +1,78 @@ +/************************************************************************** + * 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 $ */ + +//------------------------------------------------------------------------ +// Lego generator in Eta bins +// Uses geantino rays to check the material distributions and detector's +// geometry +// Author: A.Morsch +//------------------------------------------------------------------------ + +#include "TRandom.h" + +#include "AliLegoGeneratorEtaR.h" +#include "AliRun.h" +#include "AliMC.h" +#include "AliLog.h" + +ClassImp(AliLegoGeneratorEtaR) + + +//___________________________________________ +void AliLegoGeneratorEtaR::Generate() +{ +// Create a geantino with kinematics corresponding to the current bins +// Here: Coor1 = phi +// Coor2 = eta. + + // + // Rootinos are 0 + const Int_t kMpart = 0; + Float_t orig[3], pmom[3]; + Float_t t, cost, sint, cosp, sinp; + fCurCoor1 = fCoor1Min + (fCoor1Max - fCoor1Min) * gRandom->Rndm(); + fCurCoor2 = fCoor2Min + (fCoor2Max - fCoor2Min) * gRandom->Rndm(); + + Float_t phi = fCurCoor1 * TMath::Pi() / 180.; + Float_t theta = 2. * TMath::ATan(TMath::Exp(-fCurCoor2)); + + + cost = TMath::Cos(theta); + sint = TMath::Sin(theta); + cosp = TMath::Cos(phi); + sinp = TMath::Sin(phi); + + pmom[0] = cosp * sint; + pmom[1] = sinp * sint; + pmom[2] = cost; + + // --- Where to start + orig[0] = orig[1] = orig[2] = 0; + Float_t dalicz = 3000; + if (fRadMin > 0) { + t = PropagateCylinder(orig, pmom, fRadMin, dalicz); + orig[0] = pmom[0]*t; + orig[1] = pmom[1]*t; + orig[2] = pmom[2]*t; + if (TMath::Abs(orig[2]) > fZMax) return; + } + + Float_t polar[3]={0.,0.,0.}; + Int_t ntr; + gAlice->GetMCApp()->PushTrack(1, -1, kMpart, pmom, orig, polar, 0, kPPrimary, ntr); + +} diff --git a/STEER/AliLegoGeneratorEtaR.h b/STEER/AliLegoGeneratorEtaR.h new file mode 100644 index 00000000000..68a2e37e471 --- /dev/null +++ b/STEER/AliLegoGeneratorEtaR.h @@ -0,0 +1,36 @@ +#ifndef ALILEGOGENERATORETAR_H +#define ALILEGOGENERATORETAR_H +/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * + * See cxx source for full Copyright notice */ + +/* $Id$ */ + +/////////////////////////////////////////////////////////////////////////////// +// // +// // +// Utility class to compute and draw Radiation Length Map // +// // +// // +/////////////////////////////////////////////////////////////////////////////// + +#include "AliLegoGenerator.h" + +class AliLegoGeneratorEtaR : public AliLegoGenerator +{ + + public: + AliLegoGeneratorEtaR() {} + virtual ~AliLegoGeneratorEtaR() {} + virtual void Generate(); + ClassDef(AliLegoGeneratorEtaR, 1) // Lego GeneratorEtaR +}; + +#endif + + + + + + + + diff --git a/STEER/STEERLinkDef.h b/STEER/STEERLinkDef.h index 27e5476bfab..d15e237ec61 100644 --- a/STEER/STEERLinkDef.h +++ b/STEER/STEERLinkDef.h @@ -40,6 +40,7 @@ #pragma link C++ class AliLegoGeneratorXYZ+; #pragma link C++ class AliLegoGeneratorPhiZ+; #pragma link C++ class AliLegoGeneratorEta+; +#pragma link C++ class AliLegoGeneratorEtaR+; #pragma link C++ class AliDigitNew+; #pragma link C++ class AliGeometry+; #pragma link C++ class AliRecPoint+; diff --git a/STEER/libSTEER.pkg b/STEER/libSTEER.pkg index 782358183ab..f2ab01ae004 100644 --- a/STEER/libSTEER.pkg +++ b/STEER/libSTEER.pkg @@ -7,7 +7,7 @@ AliLego.cxx AliModule.cxx AliDigitNew.cxx \ AliGeometry.cxx AliRecPoint.cxx AliSegmentation.cxx \ AliHitMap.cxx AliMagFC.cxx AliMagFCM.cxx \ AliMagFDM.cxx AliLegoGenerator.cxx AliLegoGeneratorXYZ.cxx\ -AliLegoGeneratorPhiZ.cxx AliLegoGeneratorEta.cxx \ +AliLegoGeneratorPhiZ.cxx AliLegoGeneratorEta.cxx AliLegoGeneratorEtaR.cxx \ AliRndm.cxx \ AliMCQA.cxx AliPDG.cxx AliDebugVolume.cxx \ AliGenEventHeader.cxx AliStack.cxx AliConfig.cxx \ -- 2.39.3