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

Fixes and extensions for gen particle collection #49

Merged
merged 6 commits into from
Sep 18, 2017

Conversation

jkiesele
Copy link
Contributor

Addresses #45 .

Changes proposed in this pull-request:
Additions:
A1) extrapolation of each generated particle to the first HGCal layer (whether it decayed or not). Corresponding 4 branches (exx,exy,exeta,exphi) are added to the ntuple. Needed for DNN studies.
A2) origin vertex information (x,y,z), there used to be only the decay vertex information

Bugfixes:
B1) change all extrapolations to FullSim rather than FastSim. FastSim does not do a good job in the inhomogeneous field in the endcaps

Changes:
C1) Right now, each electron or particle that fulfils "myTrack.genpartIndex()>=0" gets fully propagated to the HGCal and it's decay vertex is set to the first HGCal layer, even if it decays in the meantime. This overlaps with the additions in A1 and was always affected by bug B1. Please let me know if this feature is used by anybody. Since the same information is now given by addition A1, I would propose to remove this feature.
For the DNN studies, I need the information on the real decay vertex, that I would otherwise need to add for these particular particles in new branches.

Copy link
Contributor

@clelange clelange left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good to me, haven't tested it myself though. Could you please also update https://github.com/CMS-HGCAL/reco-ntuples/blob/master/Definitions.md ?
@artlbv and @beaudett might want to add.

@@ -94,8 +188,10 @@ void computeWidth(const reco::HGCalMultiCluster& cluster, math::XYZPoint & bar,


// ---------parameters ----------------------------
bool readOfficialReco;
//bool readOfficialReco;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please delete lines referring to readOfficialReco instead of commenting them out.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why getting rid of this flag and the associated possibility to read either simTracks/Vertices or TrackingParticles/Vertices? Can't we keep both?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The tracking particles collection did not include all generated particles. That was the reason to switch.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rovere Do you see any advantage in keeping both collections or a use case for TrackingParticles/Vertices?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe @malgeri can comment better on this topic.


if(std::abs(myTrack.vertex().position().z())>=layerPositions[0]) continue;

/*
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this comment useful?

mySimEvent->fill(*simTracksHandle,*simVerticesHandle);


//SimTrack test;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please remove comment

for(size_t i=0;i<allselectedgentracks.size();i++){
auto track=allselectedgentracks.at(i);
if(track->noMother())continue;
for(size_t j=0;j<allselectedgentracks.size();j++){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't we do the usual half matrix instead of the full N^2 loop?, Like starting j=i+1?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem is that 'i' can be mother of 'j', but 'j' not mother of 'i'. We could ask the cross reference, that is true, then we could use the half matrix.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rovere Let me know if you're OK with leaving it like that or prefer the cross reference.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jkiesele maybe running on half the matrix and testing both cases (i is a mother for j and j is a mother for i) would cover all possibilities, moving the ifs inside the nested loops.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I will implement it.
Can we move forward after I implemented it?
It is already in the pipeline for quite some time.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, thanks, I had hoped that Luca @malgeri would comment on the other item. Maybe I'll catch him tomorrow.

@clelange
Copy link
Contributor

Let's briefly discuss on Monday morning at our meeting whether to keep the TrackingParticle/TrackingVertex options and then merge it.

@clelange
Copy link
Contributor

Waiting for changes in CMS-HGCAL/reco-prodtools#33 and will then merge. Discussion with Luca gave that we do not need to retain readOfficialReco option.

@clelange clelange merged commit 86c1f4b into CMS-HGCAL:master Sep 18, 2017
beaudett pushed a commit to beaudett/reco-ntuples that referenced this pull request Nov 29, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants