Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bsunanda:Phase2 hgx41Validation code due to Maksat #13626

Merged
merged 4 commits into from Mar 18, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
50 changes: 50 additions & 0 deletions SimDataFormats/ValidationFormats/interface/PHGCalValidInfo.h
@@ -0,0 +1,50 @@
#ifndef SimDataFormatsValidationFormatsPHGCalValidInfo_h
#define SimDataFormatsValidationFormatsPHGCalValidInfo_h

#include <string>
#include <vector>
#include <memory>

///////////////////////////////////////////////////////////////////////////////
////// PHGCalValidInfo
///////////////////////////////////////////////////////////////////////////////

class PHGCalValidInfo {

public:

PHGCalValidInfo() : edepEETot(0.0), edepHEFTot(0.0), edepHEBTot(0.0) {}
virtual ~PHGCalValidInfo() {}

float eeTotEdep() const {return edepEETot;}
float hefTotEdep() const {return edepHEFTot;}
float hebTotEdep() const {return edepHEBTot;}

std::vector<float> eehgcEdep() const {return hgcEEedep;}
std::vector<float> hefhgcEdep() const {return hgcHEFedep;}
std::vector<float> hebhgcEdep() const {return hgcHEBedep;}
std::vector<unsigned int> hitIndex() const {return hgcHitIndex;}
std::vector<float> hitvtxX() const {return hgcHitVtxX;}
std::vector<float> hitvtxY() const {return hgcHitVtxY;}
std::vector<float> hitvtxZ() const {return hgcHitVtxZ;}

void fillhgcHits(const std::vector<unsigned int> & hitindex,
const std::vector<double> & hitvtxX,
const std::vector<double> & hitvtxY,
const std::vector<double> & hitvtxZ);

void fillhgcLayers(const double edepEE, const double edepHEF,
const double edepHEB, const std::vector<double> & eedep,
const std::vector<double> & hefdep,
const std::vector<double> & hebdep);

private:

float edepEETot, edepHEFTot, edepHEBTot;
std::vector<float> hgcEEedep, hgcHEFedep, hgcHEBedep;
std::vector<float> hgcHitVtxX, hgcHitVtxY, hgcHitVtxZ;
std::vector<unsigned int> hgcHitIndex;

};

#endif
43 changes: 43 additions & 0 deletions SimDataFormats/ValidationFormats/src/PHGCalValidInfo.cc
@@ -0,0 +1,43 @@
#include "SimDataFormats/ValidationFormats/interface/PHGCalValidInfo.h"

///////////////////////////////////////////////////////////////////////////////
//// PHGCalValidInfo
///////////////////////////////////////////////////////////////////////////////

void PHGCalValidInfo::fillhgcHits(const std::vector<unsigned int> & hitindex,
const std::vector<double> & hitvtxX,
const std::vector<double> & hitvtxY,
const std::vector<double> & hitvtxZ) {
for (unsigned int i=0; i<hitvtxX.size(); i++) {
hgcHitVtxX.push_back((float)hitvtxX.at(i));
hgcHitVtxY.push_back((float)hitvtxY.at(i));
hgcHitVtxZ.push_back((float)hitvtxZ.at(i));
hgcHitIndex.push_back(hitindex.at(i));
}
}

void PHGCalValidInfo::fillhgcLayers(const double edepEE, const double edepHEF,
const double edepHEB,
const std::vector<double> & eedep,
const std::vector<double> & hefdep,
const std::vector<double> & hebdep) {
edepEETot = (float)edepEE;
edepHEFTot = (float)edepHEF;
edepHEBTot = (float)edepHEB;

for (unsigned int i=0; i<eedep.size(); i++) {
double en = 0.001*eedep[i]; //GeV
hgcEEedep.push_back((float)en);
}

for (unsigned int i=0; i<hefdep.size(); i++) {
double en = 0.001*hefdep[i]; //GeV
hgcHEFedep.push_back((float)en);
}

for (unsigned int i=0; i<hebdep.size(); i++) {
double en = 0.001*hebdep[i]; //GeV
hgcHEBedep.push_back((float)en);
}

}
4 changes: 4 additions & 0 deletions SimDataFormats/ValidationFormats/src/classes.h
Expand Up @@ -6,6 +6,7 @@
#include "SimDataFormats/ValidationFormats/interface/MaterialAccountingStep.h"
#include "SimDataFormats/ValidationFormats/interface/MaterialAccountingDetector.h"
#include "SimDataFormats/ValidationFormats/interface/MaterialAccountingTrack.h"
#include "SimDataFormats/ValidationFormats/interface/PHGCalValidInfo.h"

namespace SimDataFormats_ValidationFormats {
struct dictionary {
Expand Down Expand Up @@ -69,5 +70,8 @@ namespace SimDataFormats_ValidationFormats {
MaterialAccountingTrack matrack;
std::vector<MaterialAccountingTrack> matrack_v;
edm::Wrapper<std::vector<MaterialAccountingTrack> > matrack_w;

PHGCalValidInfo dummyHGC;
edm::Wrapper<PHGCalValidInfo> theValidData10;
};
}
7 changes: 6 additions & 1 deletion SimDataFormats/ValidationFormats/src/classes_def.xml
Expand Up @@ -167,12 +167,17 @@
</class>
<class name="std::vector<MaterialAccountingDetector>"/>
<class name="edm::Wrapper<std::vector<MaterialAccountingDetector> >"/>

<class name="MaterialAccountingTrack" ClassVersion="10">
<version ClassVersion="10" checksum="3618055651"/>
<field name="m_current_volume" transient="true"/>
<field name="m_detector" transient="true"/>
</class>
<class name="std::vector<MaterialAccountingTrack>"/>
<class name="edm::Wrapper<std::vector<MaterialAccountingTrack> >"/>

<class name="PHGCalValidInfo" ClassVersion="11">
<version ClassVersion="11" checksum="3282014028"/>
</class>
<class name="edm::Wrapper<PHGCalValidInfo>"/>
</lcgdict>
5 changes: 5 additions & 0 deletions Validation/HGCalValidation/plugins/BuildFile.xml
Expand Up @@ -7,12 +7,17 @@
<use name="SimDataFormats/Track"/>
<use name="SimDataFormats/GeneratorProducts"/>
<use name="SimDataFormats/CaloHit"/>
<use name="SimDataFormats/ValidationFormats"/>
<use name="Geometry/HGCalCommonData"/>
<use name="Geometry/HGCalGeometry"/>
<use name="CalibFormats/HcalObjects"/>
<use name="Geometry/Records"/>
<use name="DQMServices/Core"/>
<use name="DetectorDescription/Core"/>
<use name="SimG4Core/Notification"/>
<use name="SimG4Core/Watcher"/>
<use name="SimG4CMS/Calo"/>
<use name="geant4core"/>
<use name="clhep"/>
<use name="hepmc"/>
<flags EDM_PLUGIN="1"/>