22 #include "CLHEP/Units/GlobalSystemOfUnits.h"
41 virtual void endJob()
override ;
83 std::cout <<
"analyze does nothing" << std::endl;
93 std::string elementaryMaterialFileName(
"ELEMENTARYMATERIALS.dat");
94 std::string compositeMaterialFileName(
"COMPOSITEMATERIALS.dat");
95 std::string materialFractionFileName(
"MATERIALFRACTIONS.dat");
97 std::ofstream materialOS(materialFileName.c_str());
98 std::ofstream elementaryMaterialOS(elementaryMaterialFileName.c_str());
99 std::ofstream compositeMaterialOS(compositeMaterialFileName.c_str());
100 std::ofstream materialFractionOS(materialFractionFileName.c_str());
103 std::cout <<
"MaterialForOnline Analyzer..." << std::endl;
113 for (; mit != med; ++mit) {
114 if (! mit->isDefined().second)
continue;
116 materialOS<<material.
name()<<
","<<material.
density()/
g*cm3
120 elementaryMaterialOS<<material.
name()<<
","<<material.
z()
121 <<
","<<material.
a()/
g*mole
125 compositeMaterialOS<<material.
name()
129 materialFractionOS<<material.
name()<<
","<<f.first.
name()
137 elementaryMaterialOS.close();
138 compositeMaterialOS.close();
139 materialFractionOS.close();
virtual void endJob() override
double a() const
returns the atomic mass
virtual void analyze(const edm::Event &, const edm::EventSetup &) override
DDMaterial is used to define and access material information.
#define DEFINE_FWK_MODULE(type)
virtual void beginRun(const edm::Run &, const edm::EventSetup &) override
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e g
double z() const
retruns the atomic number
FractionV::value_type constituent(int i) const
returns the i-th compound material and its fraction-mass
MaterialForOnline(const edm::ParameterSet &)
Container::value_type value_type
double density() const
returns the density
int noOfConstituents() const
returns the number of compound materials or 0 for elementary materials
static DDI::Store< DDName, DDI::Material * >::iterator begin()
static DDI::Store< DDName, DDI::Material * >::iterator end()
const std::string & name() const
Returns the name.