Cluster filter in Allpix


I am simulating lot of thermal neutrons. Is there a way to filter out cluster formed by gammas. and attain only neutron clusters.


Hello Sanchit,

there are multiple ways, let me sketch two of them:

The first option would be to save your simulated data to file (ROOTObjectWriter). Here there is already one problem: Clusters are not yet implemented to be saved to disk, but only PixelHits. However, if you want to filter PixelHits this can be done by writing a script (you can e.g. adapt the script in tools/root_analysis_macros/ that reads in the ROOT file and iterates over the PixelHits. The class PixelHit offers the method getPrimaryMCParticles() returning a vector of MCParticles from which the clusters originate. The class MCParticle offers the method getParticleID(), returning the PDG particle code. This you can use to filter the PixeHits.

Another way is to edit the DetectorHistogrammer itself, such that you filter out the PixelHits as mentioned above. If you’d like to filter full clusters only, you’d still have to go via cluster->GetPixelHits() and then the abovementioned solution.

The ideal way would of course be to implement the Clusters to be written out like all other objects, then you could directly filter those using an analysis macro.

I hope I could help.