// 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" void Usage(void); void ParseCommandLineArguments(int narg, char *argv[]); double PTOT=-1.0; double THETA=-1.0; double PTOTDELTA=0.0; double THETADELTA=0.0; int NPVALS=1; int NTHETAVALS=1; bool OUTPUT_C_PLUS_PLUS=false; //------------ // main //------------ int main(int narg, char *argv[]) { ParseCommandLineArguments(narg, 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(); if(OUTPUT_C_PLUS_PLUS)cout<<"/*"<0)p += (double)i*PTOTDELTA/((double)NPVALS-1.0); // Loop over theta vals for(int j=0; j0)theta += (double)j*THETADELTA/((double)NTHETAVALS-1.0); TVector3 mom; mom.SetMagThetaPhi(p, theta*M_PI/180.0, 0.0); double pt_res, theta_res, phi_res; res->GetResolution(8, mom, pt_res, theta_res, phi_res); if(OUTPUT_C_PLUS_PLUS){ cout<<"{"<