// This is s simple example program that shows how to use a DTrackResolution // class to apply detector derived resolutions to charged tracks. // There are detailed comments that should step you through the program // with enough information to understand it and allow you to modify it to // your own needs. #include using namespace std; #include #include "DTrackingResolutionGEANT.h" //------------ // main //------------ int main(int narg, char *argv[]) { // Create a DTrackingResolution object. Specifically, // we create a DTrackingResolutionGEANT object so as // to use the resolutions derived from the GEANT-based // simulations. DTrackingResolution *res = new DTrackingResolutionGEANT(); // Open a root file to hold our output histogram(s) TFile *f = new TFile("hdparsim.root","RECREATE"); if(!f->IsOpen()){ cerr<<"Unable to open ROOT output file!"<Smear(PiPlus, mom); // Fill histogram dp_over_p_vs_p->Fill(ptot, (ptot-mom.Mag())/mom.Mag()); } // Close ROOT output file f->Write(); delete f; return 0; }