Skip to content

Commit

Permalink
Merge pull request #53 from vvolkl/fccsw-v0.9
Browse files Browse the repository at this point in the history
Corrections for a new tag compatible with FCCSW v0.9
  • Loading branch information
zaborowska authored Jan 15, 2018
2 parents 22b5abc + 6c4a7e0 commit e3206e1
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 37 deletions.
17 changes: 11 additions & 6 deletions edm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@ components:
x : float
y : float
z : float

fcc::StepPoints:
preStep : fcc::Point
postStep : fcc::Point

# really need to expose some function f(Cellid) -> position
fcc::BareHit:
Expand Down Expand Up @@ -149,6 +145,7 @@ datatypes :
Description : "Naive MET type"
Author : "C. Bernet, B. Hegner"
Members :
- fcc::Point position // The pre step point in global frame
- float magnitude // Magnitude (could be the pT or the ET of the MET vector)
- float phi // Azimuthal angle
- float scalarSum // Corresponding sum pT or sum ET
Expand All @@ -173,12 +170,20 @@ datatypes :
- fcc::BareHit core // The hit

fcc::PositionedTrackHit:
Description: "A track hit and with its global pre and post step positions."
Description: "A track hit and with its global step positions."
Author: "J. Lingemann, B. Hegner, J. Hrdinka"
Members:
- fcc::StepPoints positions // The pre and post step points in global frame
- fcc::Point position // The pre step point in global frame
- fcc::BareHit core // The hit

fcc::DigiTrackHitAssociation:
Description: "Association between a track hit and additional digi information"
Author : "V.Volkl"
Members:
- fcc::Point postStepPosition // The post step point in global frame.
OneToOneRelations:
- fcc::PositionedTrackHit hit // The hit

fcc::CaloHitMCParticleAssociation:
Description: "Association between a CaloHit and a particle that contributed to the hit."
Author : "C. Bernet, B. Hegner"
Expand Down
8 changes: 4 additions & 4 deletions examples/read.cc
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ void processEvent(podio::EventStore& store, bool verbose,
for(auto part = jet.particles_begin(); part != jet.particles_end(); ++part) {
if(part->isAvailable()) {
if(verbose)
std::cout<<"\t\tassociated "<<part->core()<<std::endl;
std::cout<<"\t\tassociated "<< utils::to_string(part->core())<<std::endl;
injets.push_back(*part);
}
}
Expand All @@ -81,7 +81,7 @@ void processEvent(podio::EventStore& store, bool verbose,
std::cout << "particle collection:" << std::endl;
for(const auto& ptc : *ptcs){
if(verbose)
std::cout<<"\t"<<ptc<<std::endl;
std::cout<<"\t"<<utils::to_string(ptc)<<std::endl;
if( ptc.core().pdgId == 4 ) {
muons.push_back(ptc);
}
Expand All @@ -100,12 +100,12 @@ void processEvent(podio::EventStore& store, bool verbose,
dRMax);
float sumpt = utils::sumPt(incone);
if( verbose ) {
std::cout<<"muon: "<<muon<<" sumpt "<<sumpt<<std::endl;
std::cout<<"muon: "<<utils::to_string(muon)<<" sumpt "<<sumpt<<std::endl;
std::cout<<"\tparticles in cone:"<<std::endl;
}
for(const auto& ptc : incone) {
if( verbose )
std::cout<<"\t"<<ptc<<std::endl;
std::cout<<"\t"<<utils::to_string(ptc)<<std::endl;
}
}
}
Expand Down
40 changes: 16 additions & 24 deletions utilities/ParticleUtils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -86,34 +86,26 @@ namespace utils {
}


} // namespace

std::ostream& operator<<(std::ostream& out, const fcc::BareParticle& ptc) {
if(not out) return out;

std::string to_string(const fcc::BareParticle& ptc) {

TLorentzVector p4 = utils::lvFromPOD(ptc.p4);
out<< "particle PDG ID " << ptc.pdgId
<< " e " << p4.E()
<< " pt " << p4.Pt()
<< " eta " << p4.Eta()
<< " phi " << p4.Phi();
return out;
return "particle PDG ID " + std::to_string(ptc.pdgId)
+ " e " + std::to_string(p4.E())
+ " pt " + std::to_string(p4.Pt())
+ " eta " + std::to_string(p4.Eta())
+ " phi " + std::to_string(p4.Phi());
}

std::ostream& operator<<(std::ostream& out, const fcc::Particle& ptc) {
if(not out) return out;
operator<<(out, ptc.core());
return out;
std::string to_string(const fcc::Particle& ptc) {
return utils::to_string(ptc.core());
}

std::ostream& operator<<(std::ostream& out, const fcc::MCParticle& ptc) {
if(not out) return out;

operator<<(out, ptc.core());
if(not out) return out;
out << " startVertex ID: (" << ptc.startVertex().getObjectID().collectionID;
out << ", " << ptc.startVertex().getObjectID().index << ")";
out << " endVertex ID: (" << ptc.endVertex().getObjectID().collectionID;
out << ", " << ptc.endVertex().getObjectID().index << ")";
return out;
std::string to_string(const fcc::MCParticle& ptc) {
return utils::to_string(ptc.core()) +
" startVertex ID: (" + std::to_string(ptc.startVertex().getObjectID().collectionID) +
+ ", " + std::to_string(ptc.startVertex().getObjectID().index) + ")" +
" endVertex ID: (" + std::to_string(ptc.endVertex().getObjectID().collectionID) +
", " + std::to_string(ptc.endVertex().getObjectID().index) + ")";
}
} // namespace
6 changes: 3 additions & 3 deletions utilities/ParticleUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ namespace utils {
/// returns the sum of the p4 of the particles in ps
TLorentzVector sumP4(const std::vector<fcc::Particle>& ps);

std::string to_string(const fcc::BareParticle& ptc);
std::string to_string(const fcc::Particle& ptc);
std::string to_string(const fcc::MCParticle& ptc);
}

std::ostream& operator<<(std::ostream& out, const fcc::BareParticle& ptc);
std::ostream& operator<<(std::ostream& out, const fcc::Particle& ptc);
std::ostream& operator<<(std::ostream& out, const fcc::MCParticle& ptc);

#endif

0 comments on commit e3206e1

Please sign in to comment.