|
| 1 | +// Copyright CERN and copyright holders of ALICE O2. This software is |
| 2 | +// distributed under the terms of the GNU General Public License v3 (GPL |
| 3 | +// Version 3), copied verbatim in the file "COPYING". |
| 4 | +// |
| 5 | +// See http://alice-o2.web.cern.ch/license for full licensing information. |
| 6 | +// |
| 7 | +// In applying this license CERN does not waive the privileges and immunities |
| 8 | +// granted to it by virtue of its status as an Intergovernmental Organization |
| 9 | +// or submit itself to any jurisdiction. |
| 10 | + |
| 11 | +/// \author R+Preghenella - June 2017 |
| 12 | + |
| 13 | +#include "Generators/PrimaryGenerator.h" |
| 14 | +#include "Generators/InteractionDiamondParam.h" |
| 15 | +#include "FairLogger.h" |
| 16 | + |
| 17 | +namespace o2 |
| 18 | +{ |
| 19 | +namespace eventgen |
| 20 | +{ |
| 21 | + |
| 22 | +/*****************************************************************/ |
| 23 | + |
| 24 | +Bool_t PrimaryGenerator::Init() |
| 25 | +{ |
| 26 | + /** init **/ |
| 27 | + |
| 28 | + /** retrieve and set interaction diamond **/ |
| 29 | + auto diamond = InteractionDiamondParam::Instance(); |
| 30 | + setInteractionDiamond(diamond.position, diamond.width); |
| 31 | + |
| 32 | + /** base class init **/ |
| 33 | + return FairPrimaryGenerator::Init(); |
| 34 | +} |
| 35 | + |
| 36 | +/*****************************************************************/ |
| 37 | + |
| 38 | +void PrimaryGenerator::setInteractionDiamond(const Double_t* xyz, const Double_t* sigmaxyz) |
| 39 | +{ |
| 40 | + /** set interaction diamond **/ |
| 41 | + |
| 42 | + LOG(INFO) << "Setting interaction diamond: position = {" |
| 43 | + << xyz[0] << "," << xyz[1] << "," << xyz[2] << "} cm"; |
| 44 | + LOG(INFO) << "Setting interaction diamond: width = {" |
| 45 | + << sigmaxyz[0] << "," << sigmaxyz[1] << "," << sigmaxyz[2] << "} cm"; |
| 46 | + SetBeam(xyz[0], xyz[1], sigmaxyz[0], sigmaxyz[1]); |
| 47 | + SetTarget(xyz[2], sigmaxyz[2]); |
| 48 | + SmearVertexXY(false); |
| 49 | + SmearVertexZ(false); |
| 50 | + SmearGausVertexXY(true); |
| 51 | + SmearGausVertexZ(true); |
| 52 | +} |
| 53 | + |
| 54 | +/*****************************************************************/ |
| 55 | +/*****************************************************************/ |
| 56 | + |
| 57 | +} /* namespace eventgen */ |
| 58 | +} /* namespace o2 */ |
| 59 | + |
| 60 | +ClassImp(o2::eventgen::PrimaryGenerator) |
0 commit comments