Commit 667b43f4 authored by Pavol Strizenec's avatar Pavol Strizenec Committed by Graeme Stewart
Browse files

removing ParticleGenerator (LArGeoH62004Algs-00-01-08)

parent 0439f919
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
#ifndef __ExcluderConstructionH62004_H__
#define __ExcluderConstructionH62004_H__
#include "GeoModelKernel/GeoFullPhysVol.h"
#include "GeoModelKernel/GeoPhysVol.h"
namespace LArGeo {
class ExcluderConstructionH62004 {
public:
ExcluderConstructionH62004(int which = 0);
virtual ~ExcluderConstructionH62004();
GeoVFullPhysVol* GetEnvelope();
private:
int m_which;
};
} // namespace LArGeo
#endif // __ExcluderConstructionH62004_H__
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
// FCALConstructionH62004
// Insert the LAr FCAL into a pre-defined mother volume.
// Author: Joe Boudreau August 204
#ifndef __FCALConstructionH62004_H__
#define __FCALConstructionH62004_H__
#include "GeoModelKernel/GeoFullPhysVol.h"
// Forward declarations
class ISvcLocator;
class IRDBRecordset;
namespace LArGeo {
class FCALConstructionH62004
{
public:
// Constructor;
FCALConstructionH62004();
// Destructor:
virtual ~FCALConstructionH62004();
// Get the envelope containing this detector.
GeoVFullPhysVol* GetEnvelope();
// Set a limit on cell number (for Visualization only);
void setFCALVisLimit(int maxCell) {m_VisLimit = maxCell;}
// Clean memory taken by RDBRecordsets
void cleanMemory();
private:
// It is illegal to copy a FCALConstructionH62004:
FCALConstructionH62004 (const FCALConstructionH62004 &);
// It is illegal to assign a FCALConstructionH62004:
FCALConstructionH62004 & operator= (const FCALConstructionH62004 &);
// full physical volumes for absorbers
GeoFullPhysVol* m_absPhysical1, * m_absPhysical2, * m_absPhysical3;
int m_VisLimit;
ISvcLocator* m_svcLocator;
const IRDBRecordset* m_fcalElectrode;
const IRDBRecordset* m_fcalMod;
const IRDBRecordset* m_LArPosition;
const IRDBRecordset* m_LArAlignment;
};
} // namespace LArGeo
#endif // __FCALConstructionH62004_H__
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
// FrontBeamConstructionH62004
// adopted from FrontBeamConstructionH62002
// Pavol S. May 2007
#ifndef __FrontBeamConstructionH62004_H__
#define __FrontBeamConstructionH62004_H__
#include "GeoModelKernel/GeoPhysVol.h"
#include "GeoModelKernel/GeoFullPhysVol.h"
class IRDBAccessSvc;
class IGeoModelSvc;
class LArDetDescrManager;
namespace LArGeo {
class FrontBeamConstructionH62004
{
public:
FrontBeamConstructionH62004();
virtual ~FrontBeamConstructionH62004();
// Get the envelope containing this detector.
virtual GeoVPhysVol* GetEnvelope();
void SetManager(LArDetDescrManager* mgr){m_detectorManager = mgr;}
//void SetAxisVisState(bool state) {_axisVisState=state;}
private:
GeoPhysVol *m_H62004FrontBeamPhysical;
LArDetDescrManager *m_detectorManager;
};
} // namespace LArGeo
#endif // __FrontBeamConstructionH62004_H__
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
// HECConstructionH62004
#ifndef __HECConstructionH62004_H__
#define __HECConstructionH62004_H__
#include "GeoModelKernel/GeoFullPhysVol.h"
#include "GeoModelKernel/GeoPhysVol.h"
// Forward declarations
namespace LArGeo {
class HECConstructionH62004
{
public:
// Constructor;
HECConstructionH62004();
// Destructor:
virtual ~HECConstructionH62004();
// Get the envelope containing this detector.
GeoVFullPhysVol* GetEnvelope(); // h6Phys is GeoVPhysVol
private:
// It is illegal to copy a HECConstructionH62004:
HECConstructionH62004 (const HECConstructionH62004 &);
// It is illegal to assign a HECConstructionH62004:
HECConstructionH62004 & operator= (const HECConstructionH62004 &);
// volumes that are private member variables:
GeoFullPhysVol* m_h6Phys;
//static LArGeo::VDetectorParameters* m_parameters;
//static VDetectorParameters* HECConstructionH62004::m_parameters;
};
} // namespace LArGeo
#endif // __HECConstructionH62004_H__
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
#ifndef LArDetectorFactoryH62004_h
#define LArDetectorFactoryH62004_h 1
#include "GeoModelKernel/GeoVDetectorFactory.h"
#include "LArReadoutGeometry/LArDetectorManager.h"
class StoreGateSvc;
class LArDetDescrManager;
class LArMgrInitializer;
class CaloCell_ID;
namespace LArGeo {
class LArDetectorFactoryH62004 : public GeoVDetectorFactory {
public:
// Constructor:
LArDetectorFactoryH62004(StoreGateSvc *pDetStore);
// Destructor:
~LArDetectorFactoryH62004();
// Creation of geometry:
virtual void create(GeoPhysVol *world);
//
virtual const LArDetectorManager * getDetectorManager() const;
// Additional creation of CaloDDE for ColdTC
StatusCode storeDDE();
private:
double m_cryoXpos;
double m_tableYpos;
void getSimulationParameters();
// Illegal operations:
const LArDetectorFactoryH62004 & operator=(const LArDetectorFactoryH62004 &right);
LArDetectorFactoryH62004(const LArDetectorFactoryH62004 &right);
// The Detector
StoreGateSvc *m_detectorStore;
// The manager:
LArDetectorManager *m_detectorManager;
// CaloCell_ID also needed
const CaloCell_ID *m_cell_id;
};
} // namespace LArGeo
#endif
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
#ifndef LArDetectorToolH62004_H
#define LArDetectorToolH62004_H
#include "GeoModelUtilities/GeoModelTool.h"
class LArDetectorToolH62004 : public GeoModelTool {
public:
// Standard Constructor
LArDetectorToolH62004( const std::string& type, const std::string& name, const IInterface* parent );
// Standard Destructor
virtual ~LArDetectorToolH62004();
virtual StatusCode create( StoreGateSvc* detStore );
private:
float m_xcryo;
float m_ytable;
bool m_isrun1;
bool m_emec;
bool m_hec;
bool m_fcal;
bool m_coldnose;
bool m_printstep;
bool m_checkprim;
bool m_checkother;
};
#endif
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
// MiddleBeamConstructionH62004
// adopted from FrontBeamConstructionH62004
// Pavol S. May 2007
#ifndef __MiddleBeamConstructionH62004_H__
#define __MiddleBeamConstructionH62004_H__
#include "GeoModelKernel/GeoPhysVol.h"
#include "GeoModelKernel/GeoFullPhysVol.h"
class IRDBAccessSvc;
class IGeoModelSvc;
class LArDetDescrManager;
namespace LArGeo {
class MiddleBeamConstructionH62004
{
public:
MiddleBeamConstructionH62004();
virtual ~MiddleBeamConstructionH62004();
// Get the envelope containing this detector.
virtual GeoVPhysVol* GetEnvelope();
void SetManager(LArDetDescrManager* mgr){m_detectorManager = mgr;}
//void SetAxisVisState(bool state) {_axisVisState=state;}
private:
GeoPhysVol *m_H62004MiddleBeamPhysical;
LArDetDescrManager *m_detectorManager;
};
} // namespace LArGeo
#endif // __MiddleBeamConstructionH62004_H__
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
#ifndef __ModulesConstructionH62004_H__
#define __ModulesConstructionH62004_H__
#include "GeoModelKernel/GeoFullPhysVol.h"
#include "GeoModelKernel/GeoPhysVol.h"
#include "GeoModelKernel/GeoLogVol.h"
#include "StoreGate/DataHandle.h"
#include "GeoModelInterfaces/StoredMaterialManager.h"
class LArGeoTB2004Options;
namespace LArGeo {
#define NUM_LEAK 18
class ModulesConstructionH62004 {
public:
ModulesConstructionH62004();
virtual ~ModulesConstructionH62004();
GeoVFullPhysVol* GetEnvelope();
private:
ModulesConstructionH62004 (const ModulesConstructionH62004 &);
ModulesConstructionH62004 & operator= (const ModulesConstructionH62004 &);
int GetID(int side, int dir, int calo);
GeoLogVol* construct(int side, int dir, int calo);
HepGeom::Transform3D position(int side, int dir, int calo);
// side = 0 - left, 1 - right
// dir = 0 - side, 1 - up, 2 - back
// calo = 0 - EMEC, 1 - HEC1, 2 - HEC2, 3 - FCAL1
// 4 - FCAL2, 5 - ColdTail
GeoFullPhysVol* m_ModulesPhys;
StoreGateSvc * m_detectorStore;
DataHandle<StoredMaterialManager> m_materialManager;
const LArGeoTB2004Options *m_Options;
static float dX[NUM_LEAK], dY[NUM_LEAK], dZ[NUM_LEAK];
static float shiftX[NUM_LEAK], shiftY[NUM_LEAK], shiftZ[NUM_LEAK];
static float angleX[NUM_LEAK], angleY[NUM_LEAK], angleZ[NUM_LEAK];
int m_fcalVisLimit;
};
}
#endif // __ModulesConstructionH62004_H__
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
// MovableBeamConstructionH62004
// adopted from MovableTableConstructionH62002
// Pavol S. May 2007
#ifndef __MovableTableConstructionH62004_H__
#define __MovableTableConstructionH62004_H__
#include "GeoModelKernel/GeoPhysVol.h"
#include "GeoModelKernel/GeoFullPhysVol.h"
class IRDBAccessSvc;
class IGeoModelSvc;
class LArDetDescrManager;
namespace LArGeo {
class MovableTableConstructionH62004
{
public:
MovableTableConstructionH62004();
virtual ~MovableTableConstructionH62004();
// Get the envelope containing this detector.
virtual GeoVPhysVol* GetEnvelope();
void SetManager(LArDetDescrManager* mgr){m_detectorManager = mgr;}
//void SetAxisVisState(bool state) {_axisVisState=state;}
private:
GeoPhysVol *m_H62004MovableTablePhysical;
LArDetDescrManager *m_detectorManager;
};
} // namespace LArGeo
#endif // __MovableTableConstructionH62004_H__
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
// WarmTCConstructionH62004
#ifndef __WarmTCConstructionH62004_H__
#define __WarmTCConstructionH62004_H__
#include "GeoModelKernel/GeoFullPhysVol.h"
#include "GeoModelKernel/GeoPhysVol.h"
#include "StoreGate/DataHandle.h"
#include "GeoModelInterfaces/StoredMaterialManager.h"
namespace LArGeo {
class WarmTCConstructionH62004 {
public:
WarmTCConstructionH62004();
virtual ~WarmTCConstructionH62004();
GeoVFullPhysVol* GetEnvelope();
private:
GeoFullPhysVol* m_WarmTCPhys;
StoreGateSvc * m_detectorStore;
DataHandle<StoredMaterialManager> m_materialManager;
};
}
#endif // __WarmTCConstructionH62004_H__
package LArGeoH62004Algs
author Joe Boudreau <boudreau@pitt.edu>
use AtlasPolicy AtlasPolicy-*
use StoreGate StoreGate-* Control
#use CLIDSvc CLIDSvc-00-* Control
use GeoModelKernel GeoModelKernel-* DetectorDescription/GeoModel
use GeoModelInterfaces GeoModelInterfaces-* DetectorDescription/GeoModel
use GeoModelUtilities GeoModelUtilities-* DetectorDescription/GeoModel
use LArReadoutGeometry LArReadoutGeometry-* LArCalorimeter/LArGeoModel
private
use AtlasCLHEP AtlasCLHEP-* External
use GaudiInterface GaudiInterface-* External
use DataModel DataModel-* Control
use RDBAccessSvc RDBAccessSvc-* Database/AthenaPOOL
use CaloDetDescr CaloDetDescr-* Calorimeter
use LArG4RunControl LArG4RunControl-* LArCalorimeter/LArG4
use LArGeoCode LArGeoCode-* LArCalorimeter/LArGeoModel
use LArGeoH6Cryostats LArGeoH6Cryostats-* LArCalorimeter/LArGeoModel
use LArGeoTBEC LArGeoTBEC-* LArCalorimeter/LArGeoModel
use LArGeoEndcap LArGeoEndcap-* LArCalorimeter/LArGeoModel
end_private
library LArGeoH62004Algs *.cxx -s=components *.cxx
apply_pattern component_library
# The following line would copy the contents of LArGeoAlgs/share to
# the user's run/ directory. Since there is no LArGeoAlgs/share
# directory (yet), let's save a bit of time and comment out this line.
# apply_pattern declare_runtime
apply_pattern declare_joboptions files=" *.py"
# macro LArGeoH62004Algs_cppflags " -g -O0 "
#--- ParticleGenerator -------------------------------------------------
# PDGCodes: e-=11, e+=-11, mu-=13, mu+=-13, pi+=211, pi-=-211,
# pi0=111, gamma=22, geantino=999
# Energy and momentum now in MeV!!!!
from AthenaCommon import Logging
from G4AtlasApps.SimFlags import jobproperties
log = Logging.logging.getLogger('LArGeoH62004Algs')
include("GeneratorUtils/StdEvgenSetup.py")
import ParticleGun as PG
# - Particle type (PDG code)
try:
ParticleGeneratorPDG=' constant '+ParticlePDG
particl = int(ParticlePDG)
except:
log.warning('tbH6Generator: You are running geantino')
ParticleGeneratorPDG=' constant 999'
particl = 999
# Log energy 200 - 300000 MeV
if SingleRun:
ParticleGeneratorEnergy = 'constants '+ repr(Energy)
else:
try:
ParticleGeneratorEnergy = BeamE
except:
log.warning('tbH6Generator: Wrong energy, using log 200. 300000.')
ParticleGeneratorEnergy = " log 200. 300000."
# Creating a ParticleGeneratorOrdersList
ParticleGeneratorOrdersList=[]
# Fixed values
ParticleGeneratorOrdersList += ["vertz: constant -21600."]
ParticleGeneratorOrdersList += ["targetz: constant 9367.5"]
# Particle and energy
ParticleGeneratorOrdersList += ['energy: '+ParticleGeneratorEnergy]
ParticleGeneratorOrdersList += ['pdgcode: '+ParticleGeneratorPDG]
# X coordinate + smearing
if jobproperties.SimFlags.LArTB_H1XSmear.get_Value() != 0.:
ParticleGeneratorOrdersList += ["targetx: flat -"+str(jobproperties.SimFlags.LArTB_H1XSmear.get_Value())+" "+str(jobproperties.SimFlags.LArTB_H1XSmear.get_Value())]
ParticleGeneratorOrdersList += ["vertx: targetx"]
else:
ParticleGeneratorOrdersList += ["targetx: constant 0."]
ParticleGeneratorOrdersList += ["vertx: constant 0."]
# Y coordinate + smearing
# adding beam measured Y
yreco = 1.04 * jobproperties.SimFlags.LArTB_H1TableYPos.get_Value()
yreco = 30967.3 * yreco / 30000.
if jobproperties.SimFlags.LArTB_H1YSmear.get_Value() != 0.:
ParticleGeneratorOrdersList += ["targety: flat "+str(yreco - jobproperties.SimFlags.LArTB_H1YSmear.get_Value())+" "+str(yreco + jobproperties.SimFlags.LArTB_H1YSmear.get_Value())]
ParticleGeneratorOrdersList += ["verty: targety - "+str(yreco)]
else:
ParticleGeneratorOrdersList += ["targety: constant "+str(yreco)]
ParticleGeneratorOrdersList += ["verty: constant 0."]
#ParticleGeneratorOrdersList.sort()
print ParticleGeneratorOrdersList
#jobproperties.SimFlags.ParticleGeneratorOrders = ParticleGeneratorOrdersList
import AthenaCommon.AtlasUnixGeneratorJob
#from ParticleGenerator.ParticleGeneratorConf import ParticleGenerator
#topSeq += ParticleGenerator()
#topSeq.ParticleGenerator.orders = sorted(ParticleGeneratorOrdersList)
p