LCOV - code coverage report
Current view: top level - EVGEN - AliGenFixed.cxx (source / functions) Hit Total Coverage
Test: coverage.info Lines: 27 31 87.1 %
Date: 2016-06-14 17:26:59 Functions: 6 6 100.0 %

          Line data    Source code
       1             : /**************************************************************************
       2             :  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
       3             :  *                                                                        *
       4             :  * Author: The ALICE Off-line Project.                                    *
       5             :  * Contributors are mentioned in the code where appropriate.              *
       6             :  *                                                                        *
       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             :  **************************************************************************/
      15             : 
      16             : /* $Id$ */
      17             : 
      18             : // Simple particle gun. 
      19             : // Momentum, phi and theta of the partice as well as the particle type can be set.
      20             : // If fExplicit is true the user set momentum vector is used,
      21             : // otherwise it is calculated.
      22             : // andreas.morsch@cern.ch
      23             : 
      24             : #include "TPDGCode.h"
      25             : 
      26             : #include "AliGenFixed.h"
      27             : #include "AliRun.h"
      28             :   
      29           6 : ClassImp(AliGenFixed)
      30             : 
      31             : //_____________________________________________________________________________
      32             : AliGenFixed::AliGenFixed()
      33         288 :     :AliGenerator(), 
      34         288 :      fIpart(0),
      35         288 :      fExplicit(kFALSE)
      36        1440 : {
      37             :   //
      38             :   // Default constructor
      39             :   //
      40        2304 :     for (Int_t i = 0; i < 3; i++) fP[i] = 0.;
      41             :     
      42         576 : }
      43             : 
      44             : //_____________________________________________________________________________
      45             : AliGenFixed::AliGenFixed(Int_t npart)
      46          24 :     :AliGenerator(npart),
      47          24 :      fIpart(kProton),
      48          24 :      fExplicit(kFALSE)
      49         120 : {
      50             :   //
      51             :   // Standard constructor
      52             :   //
      53          24 :   fName="Fixed";
      54          24 :   fTitle="Fixed Particle Generator";
      55         192 :   for (Int_t i = 0; i < 3; i++) fP[i] = 0.;
      56          48 : }
      57             : 
      58             : //_____________________________________________________________________________
      59             : void AliGenFixed::Generate()
      60             : {
      61             :   //
      62             :   // Generate one trigger
      63             :   //
      64         192 :   Float_t polar[3]= {0,0,0};
      65          96 :   if(!fExplicit) {
      66          96 :     fP[0] = fPMin * TMath::Cos(fPhiMin) * TMath::Sin(fThetaMin);
      67          96 :     fP[1] = fPMin * TMath::Sin(fPhiMin) * TMath::Sin(fThetaMin);
      68          96 :     fP[2] = fPMin * TMath::Cos(fThetaMin);
      69          96 :   }
      70          96 :   Int_t i, j, nt;
      71             :   //
      72          96 :   Float_t o[3] = {0., 0., 0.}; 
      73             :   Float_t time = 0.;
      74          96 :   if(fVertexSmear == kPerEvent) {
      75           0 :       Vertex();
      76           0 :       for (j = 0;j < 3; j++) o[j] = fVertex[j];
      77           0 :       time = fTime;
      78           0 :   }
      79             :   
      80         384 :   for(i = 0; i < fNpart; i++) 
      81          96 :     PushTrack(fTrackIt, -1, fIpart, fP, o , polar, time, kPPrimary, nt);
      82          96 : }
      83             :   

Generated by: LCOV version 1.11