Home

MAUS Analysis User System User Guide

image

Contents

1. Property Type Description y a or Controls the field during cavity phasing options are None Electrostatic edil di string TimeVarying and EnergyGainOptimised ngan double WhenFieldDuringPhasing is set to EnergyGainOptimised controls the peak electric field Frequency double The cavity frequency PeakEField double The peak field of the cavity Not used when the FieldDuringPhasing is Ener gyGainOptimised TimeDelay double In Phased mode the time delay absolute time of the cavity Phasing Volume string Set to SpecialVirtual to make the central volume a special virtual ReferenceParticle In Electrostatic mode MAUS calculates the peak field and the field the refer double a SN Energy ence particle sees using a combination of the reference particle energy charge ReferenceParticle 3 and phase Take defaults from datacards NominalKineticEnergy and Muon double Charge Charge MAUS tries to phase the field so that the reference particle crosses the cavity ReferenceParticle deibE at ReferenceParticlePhase units are angular 0 corresponds to no energy Phase j gain 90 corresponds to operation on crest Default from datacard rfAcclera tionPhase FileName string The file name of the field map file FileType string The file type of the field map Only supported option is SuperFishSF 8 0 10 FieldType Multipole Creates a multipole of arbitrary order Fields are generated using either
2. 42980 HIPS uoy JUIOg eds 1d eds PS UoI ddodey uO0 eS ISI ON Ie ddodej UoH ISNI sy3 qy ILddodew Joyepueaghgdew Ppd OW voyepnursddodeja SIA PS ISION HIPS DIA uonRiqyes suiddepy uosf vjeq Mey dayoedug u1q Be sey vyeqoulyoOvadddoinduy Figure 10 12 Schematic of the tracker software data showing MC and Real data input and subsequent reconstruction MAUS modules corresponding to given process are indicated MapCppTrackerRecon encompasses all of the reconstruc tion shown in blue Once digits have been formed reconstruction is agnostic as to whether the MC or Real path was followed 91 MapCppTrackerMCDigitisation This map is used to digitise Monte Carlo data MapCppTrackerRecon This map performs the main reconstruction work moving from digits to clus ter to spacepoints to pattern recognition tracks and finally full Kalman tracks Most work is farmed out to backend C classes The following are the top level classes for each stage of the reconstruction and are stored in src common_cpp Recon SciFi e SciFiClusterRecon cluster reconstruction from digits e SciFiSpacepointRecon spacepoint reconstruction from cluster e PatternRecognition association of spacepoints to tracks and crude initial track fit The backend classes for the final track fit are stored under src common_cpp Recon Kalman and src common_cpp Recon Bayes the top le
3. Description 7 6 Optimiser It is possible to define an optimiser for use in the Optics application The optimiser enables the user to vary parameters in the MiceModule file and try to find some optimum setting For each value of the parameters MAUS Optics will calculate a score the optimiser attempts to find a minimum value for this score Property Type Description LN b Controls the function used for optimising For now Minuit is the only available Optimiser string option For Minuit optimiser controls the Minuit algorithm used In general Simplex is a good option to use here An alternative is Migrad See Minuit documenta Algorithm string tion for example at http root cern ch root html TMinuit html for further information Minuit attempts to minimise the score function defined by the Score properties Maximum number of iterations MAUS will make in order to find the optimum NumberOfTries int value StartError double Guess at the initial error in the score EndError double Required final error in the score for the optimisation to converge successfully Set to False to tell MAUS not to rebuild the simulation on each iteration This RebuildSimulation bool should be used to speed up the optimiser when a parameter is used that does not change the field maps Default is true Parameter1_ Start double Seed value for the parameter that is used in the first iteration Name of the
4. L 81 Bo 2p 0 01 YLP 4 2 where parameters can be controlled in datacards as described below Note that using the datacards it is possible to define a beam ellipse that is poorly conditioned determinant nearly zero In this case MAUS will print an error message like Warning invalid value encountered in double_scalars for each primary 4 1 1 Beam Polarisation It is also possible to pass a polarised beam through MAUS A polarised beam can be generated using the beam_polarisation variable on an individual beam pa rameter Currently only one polarisation model has been implemented gaussian_unit_vectors This throws a Gaussian in each of the x y and z directions and uses this to gen erate a spin vector The spin vector is then normalised to 1 Correlations are not implemented 4 1 2 Amplitude Momentum Correlation It is possible to introduce artificially a correlation between transverse amplitude action and momentum This can be of use for high emittance beams such as those in MICE where the time of flight of high amplitude particles is signifi cantly different to the time of flight of low amplitude particles The optional a p_correlation dict enables one to specify a correlation C see table 4 8 In this case the momentum_variable W is modified according to W Wi 1 CA 4 3 W is the momentum_variable as calculated by the longitudinal routines above C is the correlation magnitude and amplitude A is calculated u
5. The scalar magnetic potential of the n n ey Sat q 0 m 0 B VV Ga th order multipole field is given by rey sarna 49q n g m n m 64 where G s is either the double Enge function G s El x 20 A El 20 A 1 Bo 1 RR 1 exp Cy Cos C382 or G s is the double tanh function E s G s tanh x x0 A 2 tanh x x0 A 2 and r y s is the position vector in the rotating coordinate system Note that here s is the distance from the nominal end of the field map Property Type Description EndField Type string Set to HardEdged to disable fringe fields Set to Enge or Tanh to use those models as described elsewhere Default is HardEdged The following properties are used for EndField Type Tanh EndLength double Set the parameter that defines the rapidity of the field fall off CentreLength double Set the zg parameter that defines the length of the flat field region Set the maximum pole that will be calculated should be larger than the MaxEndPole int multipole pole The following properties are used for EndField Type Enge EndLength double Set the parameter that defines the rapidity of the field fall off CentreLength double Set the zg parameter that defines the length of the flat field region MaxEndPole int Set the maximum pole that will be calculated should be l
6. o For Mean emit_ 6d 6d emittance emit_ 4d 4d emittance in x y space emit_ t 2d emittance in time space emit_ x 2d emittance in x space emit_ y 2d emittance in y space beta_ 4d 4d transverse beta function beta _t 2d longitudinal beta function beta_ x 2d beta function in x space beta_ y 2d beta function in y space alpha_ 4d 4d transverse alpha function alpha_ t 2d longitudinal alpha function alpha_ x 2d alpha function in x space alpha_ y 2d alpha function in y space gamma_ 4d 4d transverse gamma function gamma_ t 2d longitudinal gamma function gamma_x 2d gamma function in x space gamma _ y 2d gamma function in y space disp_ x x dispersion disp_ y y dispersion ltwiddle normalised angular momentum lkin standard angular momentum Standard _ Deviation Covariance and Correlation variables should be selected from the options e x x position e y y position e t time e px x momentum e py y momentum e E energy For Mean a single variable should be selected and value corresponding to the reference trajectory will be returned For Standard _ Deviation a single variable should be selected and the 1 sigma beam size will be returned For Covariance and Correlation two variables should be selected separated by a comma 50 Property Type Description 7 3 Unconventional Volumes It is possible to define a number of volumes that use p
7. If no rotation is defined the reference trajectory is taken along the z axis The magnitude of the momentum and the initial time of the reference trajectory is defined by properties RF cavities are phased using the reference trajectory defined here The beam ellipse is represented by a matrix which can either be set using e Twiss style parameters in x px y py and t E spaces e Twiss style parameters in t E space and Penn style parameters in a cylindrically symmetric x px y py space e A 6x6 beam ellipse matrix where the ellipse equation is given by X T MX 1 The Penn ellipse matrix is given by epmeSt ELMCOA L 0 0 0 0 D D D ermcyp HV E V E E V E E V E M erme ermcar e ermc 4Br L ermcyrp erme 4br L 0 erme ETMCAT ELMCYTP Here L is a normalised canonical angular momentum q is the reference particle charge B is the nominal on axis magnetic field p is the reference momentum m is the reference mass er is the transverse emittance r and ar are the transverse Twiss like functions ez is the longitudinal emittance and 8z and az are the longitudinal Twiss like functions Additionally D Dy Dj and D are the dispersions and their derivatives with respect to z and V E is the variance of energy given by the 2 2 term in the matrix above The Twiss ellipse matrix is given by 54 B epme ELMCA L ELMCILP 0 0 0 0 D Dy D E FV E V V E eamctz y M
8. Regis and ObjectProcessor lt ParentType gt RegisterTRef Array methods respectively 15 Other equivalent data formats for example YAML use a unique identifier to reference a pointer as reference and store the pointer as data in a reserved part of the data tree There are some consequences of storing pointers as reference using the path to a pointer as data as implemented in MAUS e The user must specify which data is the primary data source pointer as data and which data is a cross reference pointer as reference e Pointers as reference are position dependent If the associated pointer as data is moved the pointer as reference can no longer be resolved For example inserting an element into an array can cause misalignment of pointers as reference e Pointer data will always be available at the location of the pointer as data in the JSON tree even when using a parser that is not pointer aware e A unique identifier type algorithm can be implemented as a relatively simple extension of the data format outlined here but it is relatively hard to extend a unique identifier algorithm to reference existing parts of the data tree Pointer Resolution Conversion from C pointers to JSON pointers is handled in a type safe way Values as data are stored in the data tree converted at run time from JSON to C and vice versa Pointers as data are handled in the same way as Values as data Pointers as references are stored in the C dat
9. When using CavityMode Unphased MAUS needs to know when particles enter cross the middle and leave cavities To phase a cavity MAUS builds a virtual detector in the centre of the cavity that is used for phasing and then fires a reference particle through the system Stochastic processes are always disabled during this process while mean energy loss can be disabled using the datacard ReferenceEnergyLossModel If a reference particle crosses a plane through the centre of a cavity it sets the phase of the cavity to the time at which the particle crosses The field of the cavity during phasing is controlled by the property Field DuringPhasing There are four modes e None Cavity fields are disabled during phasing e Electrostatic An electrostatic field with no positional dependence given by PeakEField sin ReferenceParticlePhase is enabled during phasing e TimeVarying A standard time varying field is applied during phasing initially with arbitrary phase relative to the reference particle MAUS uses a Newton Raphson method to find the appropriate reference phase iteratively with tolerance set by the datacard PhaseTolerance e EnergyGainOptimised A standard time varying field is applied during phasing initially with arbitrary phase and peak field relative to the ref erence particle MAUS uses a 2D Newton Raphson method to find the appropriate reference phase and peak field iteratively so that the ref erence particle crosses the cavity
10. add a specified number of particles from each beam definition or sample particles from a binomial distribution The random seed is controlled at the top level and different algorithms can be selected influ encing how this is used to generate random seeds on each particle Each beam definition has routines for sampling from a multivariate gaussian distribution or generating ensembles of identical particles called pencil beams here Additionally it is possible to produce time distributions that are either rectangular or triangular in time to give a simplistic representation of the MICE time distribution The beam definition controls are split into four parts The reference branch defines the centroid of the distribution the transverse branch defines the trans verse coordinates x y px py the longitudinal branch defines the longitudi nal coordinates time and energy momentum and the coupling branch defines correlations between longitudinal and transverse Additionally a couple of pa rameters are available to control random seed generation and relative weighting between different beam definitions In transverse beams are typically sampled from a multivariate gaussian 21 The Twiss beam ellipse is defined by Ex Ba p TEx Ay 0 0 Eryr Ex YxP 0 0 B m 4 1 Pe 0 0 EyBy p yQy 4 1 0 0 EyQy Ey YyP The Penn beam ellipse is defined by B1 p 01 0 B1 Bo 2p a1 YLP L Bi Bo 2p 0 B DEN 0 L B1 Bo 2p B1 p aL
11. are developed Adding PID Variables In each derived variable class the following should be included e The variable name should be set e The function to calculate the PID variable should be defined e The minimum maximum and number of bins for PDFs created using the variable should be set The values of the minimum and maximum define the allowed range of values that the PID variable can take e In some cases it may be necessary to ensure that all bins in a PDF return non zero entries and so by setting the variable _nonZeroHistEntries to true a single event spread accross all bins will be added PIDVarA PIDVarA see PIDVarA hh and cc uses the difference between the times mea sured at TOF1 and TOFO as its variable Only for tracks where there is a single TOFO and a single TOF 1 time measurement and for which the time difference between the detectors falls within the minimum and maximum set within the class will a valid value of the variable be returned Otherwise the value of the variable is set to 1 such that it falls outside of the allowed range for the variable and so variable for the track is not used in PDF production or in the PID A point to note with PIDVarA is that it is momentum dependent and so may not be included as a final PID variable PIDVarB PIDVarB uses the correlation between the momentum measured in the upstream tracker and the difference between the times measured at TOF1 and TOFO as its variable retur
12. A circle in the x y plane may be written see Appendix 14 3 a x y Baetyytn 0 10 51 where Xo 3 10 52 0 20 0 5 Ye a l 10 53 2a P n p l2 Ta 10 54 and Xo Yo are the coordinates of the centre of the circle Initial values for a B y and are obtained as described in Appendix 14 3 The distance between the x and y coordinates of the space points in the stations l 4 i j k and the circle defined by equation 10 5 is given by Y 21 Xo y Yo p 10 55 86 In terms of the parameters a 3 y and K 6 may be written eb brity BPP K ye y Ja P do y 10 56 Points are accepted as part of a trial track if ld lt Ag 10 57 If at least one space point satisfies this selection a trial track is formed con sisting of the space points selected in stations 7 7 k and l For each trial track a circle fit is performed to calculate the fit 2 If x satisfies x 2 N 3 lt XC cut gt 10 58 then the trial track is accepted Collecting space points in the s 2 plane The set of space points which make up the trial track provide a set of s z coordinates which should lie on a straight line Equation 10 45 implies si pl 0 dp ter 10 59 The angles turned through as the track propagates from station to station j A from station j to station k A and from station i to station k
13. GEANT4 geometry What would happen if we placed the blue volume overlapping the red and black volumes The behaviour of GEANT4 is not clear in this case e Never allow a volume to overlap any part of another volume that is not it s direct parent It is possible to check for overlaps by setting the datacard Check VolumeOverlaps to 1 6 0 7 A Sample Configuration File Below is listed a sample configuration file which is likely to be included in the file ErampleConfiguration dat the actual name is specified by the datacard MiceModel Configuration ExampleConfiguration Dimensions 1500 0 1000 0 5000 0 cm PropertyString Material AIR Substitution MyRedColour 0 75 Module BeamLine SolMag dat Position 140 0 0 0 2175 0 cm 45 Rotation 0 0 30 0 0 0 degree ScaleFactor 1 if Module BeamLine BendMag dat Position 0 0 0 0 1935 0 cm Rotation 0 0 15 0 0 0 degree ScaleFactor 1 F Module NoFile_Box1 Volume Box Dimension 1 0 1 0 1 0 Position 0 0 0 0 200 0 cm Rotation 0 0 15 0 0 0 degree PropertyString Material Galactic PropertyDouble RedColour MyRedColour F Module NoFile_Box2 Volume Box Dimension 0 5 0 5 0 5 3 m z length 0 5 3 1 5m Rotation 0 0 15 0 0 0 degree Rotation relative to parent PropertyString Material Galactic PropertyDouble RedColour MyRedColour 6 0 8 A Sample Child Module File Below is listed a sample module file which is likely to be included in the file SolMag dat the actual locatio
14. MC data should then be passed through the global reconstruction Detector information is currently to added to global tracks Simulation and global recon can be performed by using the simu late_ global py script in S MAUS_ROOT_ DIR bin Global As well as performing the simu lation and TOF and Tracker reconstruction this script also calls the mappers MapCppGlobalReconImport and MapCppGlobalTrackMatching which import the detector information into the global event and then con struct the global tracks required for the calculation of PID variables The control variable to specify the name of the output Json file that contains the reconstructed tracks can be set at the command line or by using an other datacard as shown in listing 11 1 To run the global reconstruction with the datacard the following should be entered at the command line gt MAUS_ROOT_DIR bin Global simulate_global py configuration_file lt name_of_datacard gt 96 Simulation Global Reconstruction PDF Production Figure 11 1 Steps invloved in producing a PDF from MC data which for the example in would be gt MAUS_ROOT_DIR bin Global simulate_global py configuration_file ex_global_datacard py PDF Production To produce the PDFs from the reconstructed MC data pid_pdf production py in MAUS_ROOT_DIR bin Global is then used This script calls the reducer ReduceCppGlobalPID With this script a datacard such as that shown given in listi
15. O 4 4 fea a 02 epo do ata de wee oe E yr all e Se AB LA 9 9 CA 2 Ay3 4 9 VAL P c2 3 36 1 2 T8 2 Cp i S 110 14 18 14 19 14 20 14 21 14 22 14 23 14 24 14 25 14 26 14 27 14 28 14 29 14 30 14 31 14 32 Therefore y y dy II mle a 8 n Sk w S oh sh us a e SP II b oy wo SS ww os ar 8 w a 8 Ble Ble Ble co N S w Aje 8 ae uN oS o 3 o o EN Q el E co Pa er II en 00 we ve 384 4um Or o gt a V2 For the hexagonal case the area of the overlapping region shaded zone in the right panel of figure is givn by A 6 14 33 14 34 14 35 14 36 14 37 14 38 14 39 14 40 14 41 14 42 14 43 14 44 14 45 14 46 14 47 By symmetry z y 0 The variance of the x and y coordinates are given by V 0 oF qf 6 8 14 48 qf Prw 14 49 9 po 2 a de f dy V3 V3 2 x 2 dz 14 50 AJ g V3 V3 29 E dd x r Cp de Avy3 eg 22 fia ig T gt 14 51 AVS E 32 al 14 51 22 A 1 14 52 Ay3 416 38 eee 2 2 1 1 1 14 A v3 E E 5 si ee 22 i5 Ae 5 g 5 14 54 A3824 A83 eee De Ge ge DR Be 14 55 Cr C V3c2 483 V3 48 3 5 Cp V3 2 14 56 As before the covariance is given by II 1 Vey af Du
16. Rotation of MAUS co ordinate system clockwise around the y axis with respect to G4BL co ordinate system translation _z The distance between the MAUS centre and the G4BL centre It assumes the G4BL centre is in front of the MAUS centre proton_abserober_ thickness Thickness of the proton absorber proton_ number No of protons on target in G4BL proton_ weight Scales the number of protons generated with default setting pro tons are NOT generated particle_ charge Refers to the charge of the simulated particles Can be set to positive only negative only or all file path Path to G4BL input get_ magnet currents pa_cdb If set to True all magnet currents and proton absorber thickness will be retrieved from the CDB and written to the G4BL config uration file for the run number given in this dictionary 107 Chapter 14 Appendix C Tracker Appendices 14 1 Kuno s Conjecture For a given triplet space point the sum of the channel number of each cluster will be a constant To see how this comes about consider the coordinate system defined by the u v and w axes in the station reference frame shown in figure 2 1 The u v and w coordinates my be written in terms of the polar coordinates r as follows u rcos g 14 1 v recos El a 14 2 w TCOS E J 14 3 The sum u v w may now be written u v w r cosg cos o 00 7 ol 14 4 p ye
17. and translation are determined in code the length of the fibres are then determined by its position within the plane Fibre placement is then iterated over from one end of the plane to the other filling in all gaps within the area Each of the three scintillating fibre planes is built up this way In addition to these the Monte Carlo also includes a thin layer of mylar sandwiched between these planes The relative position of the three tracking planes and the three mylar layers within the station are defined in the mice modules 10 7 2 MC VLPC Dark Count When the mapper MapCppTrackerMCNoise is included in the MC each channel is tested for the presence of an integer number of PE randomly appearing in the data The chance of this per channel noise is defined by the parameter SciFi DarkCountProbabilty within the data cards while the number of PE generated is given by a Poisson distribution If a noise hit is produced it is recorded to be passed to digitization later 10 7 3 Building Digits When a particle crosses a scintillating fibre in the MC it may deposits some amount of energy in passing determined by Geant4 The digitization process takes this deposited energy and transforms it into a number of PE as follows NPE Energy SciFiFiberConvFactorxSciFiFiberTrappingE f fx 1 0 SciFiFiberMirrorE f f xSciFiFiberTransmis 10 82 Where the value of each of these variable other than the deposited energy is given in the data cards Hits in the s
18. are then given by AG 0 0 10 60 Ak 0 0 and 10 61 Adri Pk Hi 10 62 The definition of the tracker coordinate system ensures that Adj 2n7 Ap 2mm A pki 2 n m x 10 63 Azji Azx Azri urga Defining Adi ji 10 64 Mi Azsi A90 Y 10 Nkj eee and 10 65 A9 i 10 Nk Ages 10 66 Equations 10 63 may be inverted to yield Zz Azrj i AzKj m gt ji k rele 10 67 The correct values for n and m may now be obtained by calculating 87 A ji Nj and 10 68 277 AzKi n AZji ioe Azji 10 69 The most likely values of n and m for the cases of interest are n 0 and m 0 Therefore searching for values of n and m for which A T lt As 10 70 will yield the change in that corresponds to a step in z The final step in gathering the points in s z is to perform a straight line fit to the set of points corrected for multiple turns between stations If the track fit x2 satisfies then an attempt is made to fit a helix to the set of space points that make up the track Helix fit At present pattern recognition does not employ a full 3D helix fit due to the complexity of performing a non linear least squares fit The following is for reference only The construction of the tracker allows the helical locus of the points on the track to be parmeterised as a function of z The step from station 7 to station j a change in the z po
19. comparing the above relation with the conventional circle equation alz y de ey f 0 14 85 or d PEN 2 2 So 14 86 e SP 04 4 1 14 86 we find that T y 1 a w2 Ya 1 14 87 z3 ya 1 rity y 1 d r y yo 1 14 88 z3 y3 ys 1 a y s 1 e r y va 1 14 89 3 y ta 1 Ti T Yi T1 Yl f r y 22 yo 14 90 T3 T Y3 T3 Y3 and also the centre and the radius of the circle will be yant La o e Y z 14 91 d2 e2 f Hire 42 a 115
20. cos feos cos sin sino 14 5 cos E cos sin E sin s 14 6 cos 2 cos 5 cos o 14 7 r cos d cos d 14 8 0 14 9 F 1 p n If the sum is performed using the fibre numbers for the channels hit the sum of the the three views will equal the sum of the central fibre numbers i e if the central fibre numbers of each of the u v and w doublet layers is 106 5 then the sum of channel numbers will be 106 5 106 5 105 5 318 5 108 Ww Figure 14 1 Schematic representation of a point and the three plane orienta tions 14 2 Space point variance Figure 10 9 shows the arrangement of the fibre channels in the tracker The regions in which a space point will be reconstructed are shown by the shaded areas The area of the triangular intersection is given by le A as 14 10 c2 2 14 11 a where cp is the channel pitch Therefore for the triangular intersection the mean values of x and y are given by i a erw 14 12 3 af sde 7 dy 14 13 V3 12 f ES x dx 14 14 a 14 14 Loe 14 15 153 14 15 3 2 14 16 c V3 3 2 gop sand 14 17 109 1 a rew 1 f v3 a ax ydy 1 Cp y Y al A 0 S ca V3 The variance of the x and y coodinates are then given by V 0 2 x af fe dady 1 fa x d x dy A z V3 12 fe z 33H 224 Pajas A V3 Jo
21. daq_data_path src input InputCppDAQData This will run against data in run 02873 looking for files in directory src input InputCppDAQData To get a long list of all command line variables use the h switch gt MAUS_ROOT_DIR bin simulate_mice py h More complex control variables can be controlled using a configuration file which contains a list of configuration options gt MAUS_ROOT_DIR bin simulate_mice py configuration_file config py where a sample configuration file for the example above might look like simulation_geometry_filename Test dat Note that where on the command line a tag like variable value was used in the configuration file variable value is used In fact the configuration file is a python script When loaded MAUS looks for variables in it s variable list and loads them in as configuration options Other variables are ignored This gives users the full power of a scripting language while setting up run configurations For example one might choose to use a different filename import os simulation_geometry_filename os path join os environ MICEFILES Models Configurations Test dat This configuration will then load the file at MICEFILES Models Configurations Test dat The default configuration file can be found at src common_py ConfigurationDefaults py which contains a list of all possible configuration variables and is loaded by de fault by MAUS Any variables not specified by the user a
22. field to give con stant beam radius along a solenoid e twiss beam with decoupled x and y beam ellipses normalised_angular_ E R if transverse_mode is penn or momentum f constant_solenoid set emittance_4d if transverse_mode is penn or constant_solenoid set e beta_4d if transverse_mode is penn set 1 alpha_4d if transverse_mode is penn set a_ bz if transverse_mode is constant_solenoid set the B field used to calculate 8 and a_ beta_x if transverse_mode is twiss set Gy alpha_x if transverse_mode is twiss set a emittance_x if transverse_mode is twiss set y beta_y if transverse_mode is twiss set y alpha_y if transverse_mode is twiss set ay emittance_y if transverse_mode is twiss set y 25 Table 4 5 Beam definition longitudinal parameters Name Meaning The following cards should be defined in each beam definition Longitudinal dict momentum_variable In all modes set this variable to control which lon gitudinal variable will be used to control the input beam Options are energy p pz longitudinal_mode Options are e pencil time energy p pz taken from reference e gaussian uncorrelated gaussians in time and energy p pz e twiss multivariate gaussian in time and ener gy p pz e uniform_time gaussian in energy p pz and uniform in time e sawtooth_time gaussian in energy p pz and sawtooth in time beta_l In Twiss mode set 6 alpha_1 I
23. gt lt Dimension3 gt lt Units gt lt Properties gt lt Child Modules gt lt Module Name gt is the name of the module Typically the Module file name is given by lt Module Name gt dat The definition of Volume Dimensions Properties and Child Modules are described below 6 0 3 Volume and Dimensions The volume described by the MiceModule can be one of several types Replace lt Volume Type gt with the appropriate volume below Cylinder Box and Tube define cylindrical and cuboidal volumes Polycone defines an arbitrary volume of rotation and is described in detail below Wedge describes a wedge with a triangular projection in the y z plane and rectangular projections in x z and x y planes Quadrupole defines an aperture with four cylindrical pole tips In general the physical volumes that scrape the beam are defined indepen dently of the field maps This is the more versatile way to do things but there are some pitfalls which such an implementation introduces For example in hard edged fields like pillboxes tracking errors can be introduced when MAUS steps into the field region This can be avoided by adding windows probably made of vacuum material to force GEANT4 to stop tracking make a small step over the field boundary and then restart tracking inside the field However such details are left for the user to implement 43 Volume Dimension1 Dimension2 Dimension3 None N
24. o 8 0 7 Tracking Stability Around RF Cavities 8 0 8 FieldType PillBox 8 0 9 FieldType RFFieldMap 8 0 10 FieldType Multipole 8 0 11 FieldType CombinedFunction 8 0 12 EndFieldTypes 8 0 13 Field Type MagneticFieldMap o O as ate aleve sco bla Bia dhs i a do A eh ie eee he Roe A Bea ae ta 6 SS Sri anh Ge ie doe Ge wk Hy BGS AP A ahaa say ot Bea 10 2 Definitions 10 2 1 Labelling of upstream and downstream trackers 10 2 2 Station numbering 10 2 3 Doublet layer 10 2 4 Fibre channel numbering 10 3 Reference surfaces and coordinate systems 10 3 1 Doublet layer 2 2 en 1032 Station e oan ew ee AEE A aed 10 3 3 Tracker a ioi s a p e i a i g a a a a ae pe ae pe iaaa E 10 3 4 Coordinate transformations TE E E E E O 10 4 1 Hits and clusters a bods a da A 10 4 3 Pattern recognition o 10 4 4 Track fit a y e ae ea EN a ee ee ee 10 5 Data structure lt lt ss egga Aba ee 6 a we ana ee a 10 6 Code Design 2 2 0 00 0000 0002 eee 10 6 1 General Code Structure pet EE oY at a cr 10 7 1 Station Geometry o o 10 7 2 MC VLPC Dark Count o o 10 7 3 Building Digit a dd ge e ae ae ese 08 aE ES Gye Shale cores es os Ae Lerma aan Oh Arar dra
25. of child modules Typically the parent module will describe a physical volume and child modules will describe physical volumes that sit inside the parent module Modules cannot be used to describe volumes that do not sit at least partially inside the volume if the parent module Each Mice Module file consists of a series of lines of text Firstly the Module name is defined This is followed by an opening curly bracket then the descrip tion of the module and the placement of any child modules and finally a closing curly bracket Commands curly brackets etc must be separated by an end of line character Comments are indicated using either two slashes or an exclamation mark Characters placed after a comment on a line are ignored MAUS operates in a right handed coordinate system x y z In the absence of any rotation lengths are considered to be extent along the z axis widths to be extent along the z axis and heights to be extent along the y axis Rotations Ax 0 9 are defined as a rotation about the z axis through 6 followed by a rotation about the y axis through 0 followed by a rotation about the x axis through 6 6 0 1 Configuration File The Configuration file places the top level objects in MICE The location of the file is controlled by the datacard simulation_geometry_file_name MAUS looks for the configuration file in the first instance in the directory MICEFILES Models Configuration lt MiceModel gt where MICEFI
26. place of a single value So for example PropertyDouble FieldStrength 0 5 2 T would result in a FieldStrength property of 1 Tesla Expression Substitutions Some additional variables can be defined in specific cases by MAUS itself for substitution into experssions in which case they will start with symbol For these variable substitutions it is only possible to make the substitution into expressions So for example PropertyDouble ScaleFactor 2 RepeatNumber Would substitute RepeatNumber into the expression RepeatNumber is de fined by MAUS when repeating modules are used see RepeatModule2 below Note the following code is not valid PropertyString FileName File RepeatNumber NOT VALID This is because Expression Substitutions can only be used in an expression i e an equation 42 6 0 2 Module Files Children of the top level Mice Module are defined by Modules MAUS will attempt to find a module in an external file The location of the file is controlled by the parent Module Initially MAUS looks in the directory MICEFILES Models Modules lt Module gt If the Mice Module cannot be found MAUS searches the local directory If the module file still cannot be found MAUS will issue a warning and proceed The Module description is similar in structure to the Configuration file Module lt Module Name gt PropertyString Volume lt Volume Type gt PropertyHep3Vector Dimensions lt Dimensioni gt lt Dimension2
27. reas haa ete 11 3 ReduceCppGlobalPID o e 11 4 PID Variables 114 1 PID Base Classy vos ie aaa ana da 11 4 2 PID Variable Classes 12 The Envelope Tool 100 pa Reali he ee dd 100 LOGS die wal AS SS BS da a 100 12 3 Beam Setup os aa ee WOR ad eee i 100 12 4 Magnet Setup 6 ee ee 101 12 0 Plot Seb AER 102 103 105 Pa ee ee teeta bb dye tye 105 ph oe Oo AR eee ae eG 105 DEORE 109 Nara ais eee 111 Chapter 1 What Who and How MAUS MICE Analysis User Software is the MICE project s tracking detector reconstruction and accelerator physics analysis framework MAUS is designed to fulfil a number of functions for physicists interested in studying MICE data e Model the behaviour of particles traversing MICE e Model the MICE detector s electronics response to particles e Perform pattern recognition to reconstruct particle trajectories from elec tronics output e Provide a framework for high level accelerator physics analysis e Provide online diagnostics during running of MICE In addition to MAUS s role within MICE the code is also used for generic accelerator development in particular for the Neutrino Factory 1 1 Who Should Use MAUS MAUS is intended to be used by physicists interested in studying the MICE data MAUS is designed to function as a general tool for modelling particle accelerators and assoc
28. template class of the generic Hit class This class stores the MC data used by the reconstruction to form SciFiDigits via the map MapCppTrackerMCDigitisation The relationship between MC events and SciFiHits is one to many On the real data side each recon event holds a single SciFiEvent a one to one relationship The SciFiEvent then holds a collection implemented as C standard vectors of pointers for each data type used in the reconstruction pro cess SciFiDigits SciFiClusters SciFiSpacePoints SciFiStraightPRTracks Sci FiHelicalPRTracks SciFiStraightKalmanTracks and SciFiTracks Additionally SciFiTrackPoints are held by each SciFiTrack instance 10 6 Code Design 10 6 1 General Code Structure The main body of the tracker code is implemented as three distinct MAUS map modules and at present one reducer module There also exist various helpful top level user tools and the tracker geometry calibration and configuration files A diagram showing the tracker software data flow with the corresponding modules is shown in figure 10 12 with the following sections expanding on each area MapCppTrackerDigits This map is used to digitise real data It calls on additional functionality from the RealDataDigitisation class which is stored in src common_cpp Recon SciFi 89 SF Digit used spill number event number tracker number station number number of PE channel number t track ID particle ID energy energy dep
29. the hit is not digitized The energy deposited in the slab and the hit time are then digitized as described below e Charge digitization The energy deposited by a hit in a slab is first converted to units of photoelectrons The photoelectron yield from a hit is attenuated by the distance from the hit to the PMT then smeared by the photoelectron resolution The yields from all hits in a given slab are then added and the summed photoelectron yield is converted to ADC In principle this should be done not on an event by event basis but rather on a trigger basis In the absence of a real trigger all hits in a slab are now merged e Time digitization The hit time is propogated to the PMTs at either end of the slab The speed of light in the scintillator based on earlier calibration is controlled by the TOFscintLightSpeed data card The time is then smeared by the PMT time resolution and converted to TDC After converting the energy deposit to ADC and the time to TDC the TDC val ues are uncalibrated so that at the reconstruction stage they can be corrected just as is done with real data The data cards that control the digitization are listed in Table 9 2 NOTE Do not modify the default values 9 2 Reconstruction The reconstruction software treats both data and Monte Carlo the same way In the case of real data the input to the reconstruction chain is TOF Digits MapCppTOFDigit and in the case of Monte Carlo it is the digitized in
30. the physics list set up gets called by the FieldPhaser 29 e FieldPhaser the field phaser is a MAUS specific tool for automatically phasing fields for example RF cavities such that they ramp coinciden tally with incoming particles The FieldPhaser contains routines to fire test reference particles through the accelerator lattice and phase fields appropriately The FieldPhaser phasing routines are called after GEANT4 is first initialised e DetectorConstruction the DetectorConstruction routines provide an in terface between the MAUS internal geometry representation encoded in MiceModules and GEANT4 DetectorConstruction is responsible for call ing the relevant routines for setting up the general engineering geometry calling detector specific geometry set up routines and calling the field map set up routines e VirtualPlanes the VirtualPlanes routines are designed to extract particle data from the GEANT4 tracking independently of the GEANT4 geometry The VirtualPlanes routines watches for steps that step across some plane in physical space or some time or some proper time and then interpolates from the step ends to the plane in question e FillMaterials legacy the FillMaterials routines are used to initialise a number of specific e MAUSVisManager the MAUSVisManager is responsible for handling in terfaces with the GEANT4 visualisation The GEANT4 Action objects provide interfaces for MAUS specific function calls at cert
31. the position of the centre of the circle Xo Yo and its radius p are given by equations 14 68 to 14 70 113 14 4 Helical Track Pattern Recognition The equation of motion of a charged particle in an external magnetic field can be written as xr q dz gt ds p Cs x Bls 14 78 If we assume that the magnetic filed lies along the z axis B 0 0 B then the three scaler components of it can be wirttien as dix q Y ds P ds dy q dx A a SA a 14 79 ds Pas dz ae we also note that P is the total momentum and the transverse momenumte pi P cos qBRy can be written as Pa pr COS Q 14 80 Px p sin 0 the solution of the above equations will be a helix h x s x 1 R feos 8 we ei 2 hs cos i y s y R feos 8 gt di 2 14 81 z s 241 ssin where z1 y and z is the starting point R is the radius of the helix h 1 is the sense of the rotation in x y plane We note that ds dx dy dz ds dz 1 de 14 82 Ep yrs Sy 1 On the other hand the equation of a circle passing through three space points x y where 1 2 3 can be found from the following determinant x y x y 1 2 2 Ba AG 14 83 atys T2 yw 1 ae which can be re written as z y 1 iat yp y 1 fatty a 1 ld y a y a y ua ya U ajaz ys yo l yz3 y to 1 23 y a2 Ya z3 Ya 1 3 y ys 1 13 y3 z3 1 13 y3 T3 Y 14 84 114
32. to find the trigger pixel i e the x y combination that triggered this event This is done by applying calibration corrections to the slab hits and then asking if the average time in this pixel is consistent with the trigger within some tolerance In other words if ty and ty are the times corresponding to the x and y slab hits is Fnjcatib Etyyeatdb lt tiriggercut If no x y combination produces a trigger pixel the space point reconstruc tion stops and no space points are formed This is because to apply the calibration corrections to the slab hit times it is essential know the trigger pixel Once a trigger pixel is found all x y slab hit combinations are again treated as space point candidates The calibration corrections are applied to these hit times If ts ty is consistent with the resolution of the detector the combination is said to be a space point The space point thus formed contains the following information This is used by the reconstuction of the TOF detectors TOF_cabling_file files cabling TOFChannelMap txt TOF_TW_calibration_file files calibration tofcalibTW_dec2011 txt TOF_TO_calibration_file files calibration tofcalibTO_trTOF1_dec2011 txt TOF_TO_calibration_file files calibration tofcalibTO_trTOFO txt TOF_Trigger_calibration_file files calibration tofcalibTrigger_trT0F1_dec2011 txt TOF_Trigger_calibration_file files calibration tofcalibTrigger_trTOFO txt the dat
33. to the MAUS_VERSIONED_CLASS_DEF macro at the end of the class def inition before the closing braces MAUS_VERSIONED_CLASS_DEF calls the ROOT ClassDef macro which generates metaclasses based on informa tion in the class This is put into the dynamically generated MausDataStructure h cc files e Add the class to the list of classes in src common_cpp DataStructure LinkDef hh This is required for the class to be linked properly to the main library and a linker error will result if this step is not taken e Add any template definitions which you used including STL classes e g std vector lt MyClass gt or whatever to linkdef Otherwise ROOT will generate a segmentation fault whenever the user tries to call functions of the templated class but the code will link successfully in this case In order to make these classes accessible to JSON it is necessary to add a new processor in src common_cpp JsonCppProcessors There are a few default processors available e src common_cpp JsonCppProcessors ProcessorBase hh contains IPro cessor pure interface class for all processors and ProcessorBase base class which may contain some implementation 14 e src common_cpp JsonCppProcessors PrimitivesProcessors hh contains processors for primitive types BoolProcessor IntProcessor UlntProces sor StringProcessor DoubleProcessor e src common_cpp JsonCppProcessors ArrayProcessors hh contains pro cessors for array types Two processors are a
34. tracking Override with G4StepMax in MiceModule Kill tracks with time above this time Override with G4TimeMax in MiceMod ule Kill tracks with track length above this length Override with G4TrackMax in MiceModule Set to an integer value Tracks taking more steps are assumed to be looping and are killed Kill tracks with initial kinetic energy below this threshold Override with G4KinMin in MiceModule Set absolute error on MAUS internal stepping routines used by e g Virtu alPlanes to control accuracy of interpo lation Set relative error on MAUS internal stepping routines used by e g Virtu alPlanes to control accuracy of interpo lation String to control the numerical in tegration routine choose from ClassicalRK4 SimpleHeum Implici tEuler SimpleRunge ExplicitEuler or CashKarpRKF45 Set to true to use G4 routines to precess the spin vector as particles go through EM fields Accuracy with which Geant4 steps within a volume Geant4 minimum stepping relative error over a single step Takes precedence over delta_one_step Geant4 maximum stepping relative error over a single step Takes precedence over delta_one_step Accuracy with which Geant4 enters vol ume boundaries Maximum distance between track and corners used for estimating whether a track crosses a boundary 32 Table 4 11 Physics list control parameters Physics list controls physics_model physics_processes reference
35. with a NewStation number given by the total number of stations this plane s station number i e a new station number appropriate for a ring geometry AllowBackwards Bool Set to false to prevent backwards going particles from being recorded Default is true 7 2 6 Envelope Detectors Envelope detectors are a type of Virtual detector that take all of the properties listed under virtual detectors above In addition in the optics application they can be used to interact with the beam envelope in a special way The following properties can be defined for Envelope Detectors in addition to the properties specified above for virtual detectors The The EnvelopeOut properties are used to make output from the envelope for use in the Optics optimiser Property Type Description the optimiser see optimiser below Defines the variable name that can be used as an expression substitution at EnvelopeOut1_ Name String the end of each iteration typically substituted into the Score parameters in are e Mean e Covariance EnvelopeOut1_ Type String e Standard_ Deviation Correlation Bunch_ Parameter 49 Defines the type of variable that will be calculated for the substitution Options Property Type Description EnvelopeOut1_ Variable String Defines the variable that will be calculated for the substitution Options are for Bunch_ Parameter e o o o
36. 4TrackMax double The maximum track length and particle time of a track Tracks outside this G4TimeMax double bound are killed Inherits values from the parent volumes G4KinMin double The minimum kinetic energy of a track Tracks outside this bound are killed Inherits values from the parent volumes SensitiveDetector ie Set to the type of sensitive detector required Possible sensitive detectors are TOF SciFi CKOV Special Virtual Virtual Envelope or EMCAL Allocate the volume to the named Geant4 Region This is used for setting up Reston see production thresholds see simulation chapter Child modules are automati cally assigned to the parent module s region The Root module is automatically assigned to DefaultRegionForTheWorld 7 2 Sensitive Detectors A sensitive detector one in which hits are recorded can be defined by including the SensitiveDetector property When a volume is set to be a sensitive detec tor MAUS will automatically record tracks entering exiting and crossing the 47 volume Details such as the energy deposited by the track are sometimes also recorded in order to enable subsequent modelling of the detector response Some sensitive detectors use extra properties 7 2 1 Scintillating Fibre Detector SciFi 7 2 2 Cerenkov Detector CKOV 7 2 3 Time Of Flight Counter TOF 7 2 4 Special Virtual Detectors Special virtual detectors are used to monitor tracking through a particular physi cal volume Nor
37. CO q 0 0 Eg NCY xP 0 0 eyme5 yMCOy EyMCYyp Here p is the reference momentum m is the reference mass ej b and aj are the emittances and Twiss functions in the t E x px and y py planes respec tively Dx Dy D x D y are the dispersions and their derivatives with respect to z and V E is the variance of energy given by the 2 2 term in the matrix above Property Description Envelope Type Set to TrackingDerivative to evolve a beam envelope in the Optics application Set to Random to generate a beam using the parameters below for the Simu Bea Tipe lation application Set to Pencil to generate a pencil beam with no random distribution Set to ICOOL Turtle MAUS_ PrimaryGenHit or G4 BeamLine to use a beam file Pid The particle ID of particles in the envelope or beam Time Set the time of the envelope reference trajectory Longitudinal Variable Set the longitudinal variable used to define the reference trajectory momentum Options are Energy KineticEnergy Momentum and ZMomentum Energy KineticEnergy Momentum ZMomentum Define the value of the longitudinal variable used to calculate the mean mo mentum and energy The usual relationship E p c m c applies Kinetic energy Ex is related to energy E by Ex m E EllipseDefinition Define the beam ellipse that will be used in calculating the evolution of the Envelope or used to generate a beam for BeamType Random
38. ES TimeVarying and EnergyGainOptimised nendun double WhenFieldDuringPhasing is set to EnergyGainOptimised controls the peak electric field Frequency double The cavity frequency PeakEField double The peak field of the cavity Not used when the FieldDuringPhasing is Ener gyGainOptimised TimeDelay double In Phased mode the time delay absolute time of the cavity Phasing Volume string Set to SpecialVirtual to make the central volume a special virtual ReferenceParticle In Electrostatic mode MAUS calculates the peak field and the field the refer double E ites Hes Energy ence particle sees using a combination of the reference particle energy charge ReferenceParticle 1 and phase Take defaults from datacards NominalKineticEnergy and Muon double Charge Charge MAUS tries to phase the field so that the reference particle crosses the cavity ReferenceParticle ais at ReferenceParticlePhase units are angular 0 corresponds to no energy Phase 7 gain 90 corresponds to operation on crest Default from datacard rfAcclera tionPhase 8 0 9 FieldType RFFieldMap Sets a cavity with an RF field map in a particular region RFFieldMap uses the same phasing algorithm as described above Property Type Description Length double Length of the region in which the field is present CaniylMode Senne Phasing mode of the cavity options are Phased and Unphased RFFieldMaps cannot operated in Electrostatic mode 62
39. ICE tracker are shown in the line drawing The tracker reference surface coincides with the reference surface of station 1 The tracker coordinate system is indicated by the solid lines The y axis is defined to be coincident with the ys axis in the station coordinate system The z axis runs along the nominar axis of the tracker The x axis completes a right handed coordinate system Npe generated in the Visible Light Photon Counter VLPC illuminated by the hit channel Occasionally showers of particles or noise can cause three or more neighbouring channels to be hit The term clusters is used to refer to an isolated hit a doublet cluster and a multi hit cluster The position of a hit in the doublet layer coordinate system may be deter mined from the channel number For isolated hits the measured coordinate a U v w is given by a c n no 10 2 where ny is the channel number of the central fibre and c is the channel pitch given by Cp 3fp fa 10 3 where fa is the fibre diameter fg 350 um and fp is the fibre pitch fp 427 um see figure 10 2 For clusters in which two channels are hit doublet clusters see figure 10 8 the measured coordinate is given by O Cp aS no 10 4 where n and na are the channel numbers of the two hit fibres For a multi hit cluster clusters with more than two neighbouring channels the measured po sition is determined from the pulse height weighted mean o
40. LES is a user defined environment variable If MAUS fails to find the file it searches the local directory The world volume is defined in the Configuration file and any children of the world volume are referenced by the Configuration file The Configuration file looks like Configuration lt Configuration Name gt 41 Dimensions lt x gt lt y gt lt z gt lt Units gt lt Properties gt lt Child Modules gt lt Configuration Name gt is the name of the configuration Typically the Configuration file name is given by lt Configuration Name gt dat The world volume is always a rectangular box centred on 0 0 0 with x y and z extent set by the Dimensions Properties and Child Modules are described below and added as in any Module Substitutions It is possible to make keyword substitutions that substitutes all instances of lt name gt with lt value gt in all Modules The syntax is Substitution lt name gt lt value gt lt name gt must start with a single sign Substitutions must be defined in the Configuration file Note this is a direct text substitution in the MiceModules before the modules are parsed properly So for example Substitution Sub SomeText PropertyString FieldType Sub PropertyDouble SubValue 10 would be parsed as MAUS like PropertyString FieldType SomeText PropertyDouble SomeTextValue 10 Expressions The use of equations in properties of type double and Hep3Vector is also allowed in
41. MAUS Analysis User System User Guide Contents 1 1 Who Should Use MAUS o o 1 2 Getting the Code and Installing MAUS L3 Citing MA US ocioso da ee ee ee ee es 1 4 Running MA US o o oo 1 4 1 Run Control ooocooooc o o AAG SE ee oe Ss Hee Sess 1 5 Accessing Data 2 2 e 1 5 1 Loading ROOT Files in Python Using PyROOT 1 5 2 Loading ROOT Files in C Compiled Analysis Code ert ee a ee ere eee ee ebb ie a kad Se Le ede ee Biss By aires yet cocks a wee Nat ek er gee Gee 2 4 Accessing ROOT files o o re 2 6 Extending the Data Structure o o 2 6 1 Pointer Handling o 3_ Introduction to the MAUS API E A E a ee ee 3 2 Everything starts with a Module 3 4 Data Manglingl e a ia 3 1 Internal Classes 0 3 7 1 Abstraction Layers o 3 7 2 C Python Wrapper o 3 7 3 Data Manglingl ee a naw BIA Mathes asl vate A A A ae a 4 1 1 Beam Polarisation 00002 eee 4 1 2 Amplitude Momentum Correlation 4 2 Getting the Right Answer o 4 2 1 Geometry 4 2 2 Tracking 4 2 3 Energy Deposition and Showering 43 GEANT4 Bindimgs e e e 5 Geometry 5 1 Geomet
42. O u The Pattern Recognition reducer to display tracks reducer MAUS ReduceCppPatternRecognition Output to ROOT file 73 my_ output MAUS OutputCppRoot The Go drives all the components you pass in MAUS Go my_input my_map reducer my output datacards if name _ __main__ run Listing 10 1 Example SciFi python script Some important datacard parameters to consider when using the tracker soft ware are e SciFiPRHelicalOn set to True or False for helical pattern recognition e SciFiPRStraightOn set to True or False for straight pattern recognition e SciFiKalmanOn set to True or False for running the final track fit 10 2 Definitions 10 2 1 Labelling of upstream and downstream trackers The official labels for the two trackers are Upstream tracker Tracker 1 Downstream tracker gt Tracker 2 The internals of the code however will frequently refer to the upstream tracker as 0 and the downstream tracker as 1 In this document we will use the official convention 10 2 2 Station numbering The tracker reference document defines the station labelling of the stations in relation to the focus coil module that is immediately downstream of tracker 1 or equivalently immediately upstream of tracker 2 The station closest to the focus coil module in question is labelled 1 The label then increases such that station 5 is the station closest to the optical patch
43. October 2011 You are welcome to visit our Web site http root cern ch XK XA XA XA XA XX E XK XA XA XX XX XX XX Xk FESO OSORIO IORI IRIE I kkk k ROOT 5 30 03 tags v5 30 03041540 Oct 24 2011 11 51 36 on linuxx8664gcc CINT ROOT C C Interpreter version 5 18 00 July 2 2010 Type for help Commands must be C statements Enclose multiple statements between root 0 L MAUS_ROOT_DIR build 1libMausCpp so root 1 TBrowser b Note ROOT infrastructure can only be used to plot data nested within up to two dynamic arrays Data nested in three or more dynamic arrays is beyond the capabilities of ROOT interactive plotting tools explicit loops over the data are required in a PyROOT script or C code In general working through the ROOT command line or ROOT macros is notoriously unreliable and is not supported by the MAUS development team it is useful as a basic check of data integrity and no more More information on the data is available in the data structure chapter Chapter 2 Using and Modifying the Data Structure MAUS operates on data in discrete blocks primarily spills with one spill repre senting the particle burst generated by one dip of the MICE target Additionally MAUS can write data into a JobHeader RunHeader RunFooter and JobFooter data type Histograms for plotting in online mode are encoded into an Image data type The top level branch in the data tree inherits from MAUSEvent lt T gt defined in src com
44. Options are Twiss Penn and Matriz The following properties are only used if EllipseDefinition is set to Twiss Emittance_ X Emittance_ Y Emittance_ L Emittance in each 2d subspace x px y py and t E Beta_ X Beta_ Y Beta_L Twiss b function in each 2d subspace x px y py and t E Alpha_X Alpha_ Y Alpha_L Twiss a function in each 2d subspace x px y py and t E The following properties are only used if EllipseDefinition is set to Matrix Covariance t t Covariance t E Covariance t x Covariance Py Py Set the 6x6 matrix that will be used in the to define the beam ellipse Covari ances should be covariances of elements of the matrix x Px y Py t E This must be a positive definite matrix i e determinant gt 0 Note that this means that at least the 6 terms on the diagonal must be defined Other terms default to 0 55 Property Type Description The following properties are only used if EllipseDefinition is set to Penn Emittance_ T double Transverse emittance for the 4d x px y py subspace Emittance_L double Longitudinal emittance for the 2d t E subspace Beta_ T double Transverse beta for the 4d x px y py subspace Beta_L double Longitudinal beta for the 2d t E subspace Alpha_ T double Transverse alpha for the 4d x px y py su
45. _json_file_name input_json_file_type output_json_file_name output_json_file_type Set the file name used for reading input files by In putPyJSON module Set to gzip to read input from a gzipped file set to text to read input from a plain text file Set the file name used for writing output files by OutputPyJSON module Set to gzip to write output as a gzipped file set to text to write output as a plain text file header_and_footer_mode Set to append to write out job and run headers and footers set to dont_append to suppress this output 11 TFile default maus_output root ascii file default maus_output json JobHeader TTree JobFooter TTree RunHeader TTree RunFooter TTree lt new line gt lt new line gt lt new line gt lt new line gt StartOfJob EndOfjob start_of_job end_of job Figure 2 1 The MAUS file structure including metadata The top label in each box describes the representation in C ROOT The bottom label describes the representation in JSON Spill TTree lt new line gt lt spill data gt 2 2 The Spill Datastructure The major part of the MAUS data structure therefore is a tree of which each en try corresponds to the data associated with one spill The spill is separated into three main sections the MCEventArray contains an array of data each member of which represents the Monte Carlo of a single primary particle crossing the system the Reco
46. _physics_processes particle_decay polarised_decay charged_pion_half_life muon_half_life production_threshold fine_grained_production_threshold kinetic_energy_threshold 33 default_keep_or_kill GEANT4 physics model used to set up the physics list Choose which physics processes normal particles observe during tracking Options are e normal particles will obey normal physics processes scattering and energy strag gling will be active e mean_energy_loss parti cles will lose a deterministic amount of energy during interaction with materials and will never decay e none Particles will never lose energy or scatter during tracking and will never de cay Choose which physics processes the reference particle observes during tracking Options are mean_energy_loss and none The reference particle can never have stochastic processes enabled Set to boolean true to enable par ticle decay set to boolean false to disable Set to boolean true to make muons decay according to stan dard physics for a polarised muon set to boolean false to make muons decay as if unpolarised If po larised decay is true then spin tracking is automatically enabled regardless of the value of the spin_tracking datacard Set the half life for charged pions Set the half life for muons Set the geant4 production threshold Uses geant4 de faults if negative Ignored if physics_processes are not normal Set the geant4 production th
47. _virtual_hit e maus_primary When using a file particle_generator set the input file name Environment variables are automatically expanded by MAUS When using a file particle_generator this controls the number of particles per spill that will be read from the file Set the random seed which is used to gener ate individual random seeds for each primary see below A list of dicts each item of which is a dict defining the distribution from which to sam ple individual particles 23 Table 4 2 Individual beam distribution parameters Name Meaning The following cards should be inside a dict in the beam definitions list random_seed_algorithm weight n_particles_per_spill reference transverse longitudinal coupling beam_polarisation a p_correlation Choose from the following options e beam_seed use the random_seed for all particles e random use a different randomly deter mined seed for each particle e incrementing use the random_seed but increment by one each time a new particle is generated e incrementing_random determine a seed at random before any particles are gener ated increment this by one each time a new particle is generated When particle_generator is binomial or overwrite_existing the probability that a particle will be sampled from this distribution is given by weight sumof weights When particle_generator is counter this sets the number of particles that will be ge
48. a hard edged model with no fringe fields at all or an Enge model similar to ZGoubi and COSY In the former case fields are calculated using a simple polynomial expansion In the latter case fields are calculated using the polynomial expansion with an additional exponential drop off Fields can be superimposed onto a bent coordinate system to generate a sector multipole with arbitrary fixed radius of curvature Unlike most other field models in MAUS the zero position corresponds to the center of the entrance of the multipole and the multipole extends in the z direction The method to define end fields is described in the section EndFieldTypes below Property Type Description Pole int The reference pole of the magnet 1 dipole 2 quadrupole 3 sextupole etc Scale the field strength in the good field region For dipoles this sets the dipole f field for quadrupoles this sets the field gradient Note that for some end field PIER double settings there can be no good field ae e g if the end length is gt centre length Height double Height of the field region Width double Width or delta radius of the field region Length double Length of the field along the bent trajectory E Set to HardEdged to disable fringe fields Set to Enge or Tanh to use those End Peg Ly pe string models as Pe elsewhere Default is HardEdged Choose the model for curvature Straight forces no curvature Constant gives a constant radius of c
49. a tree as a TRef or TRefArray element in the normal way and in JSON as an address to the position in the tree to a pointer as data It is an error to store a pointer as reference without storing an associated pointer as data as the pointer as reference cannot be converted unless the pointer as reference is set to NULL in which case it may be an error depending on caller settings It is an error to store multiple C pointers as data to the same memory address as the conversion from C to JSON and back again would yield logically different data and the resolution of associated pointers as reference is dependent on the resolution order of the data tree which is ill defined In order to implement the data conversion the pointers have to be resolved in a two stage process In the first stage it is necessary to collect all of the pointers as data and pointers as reference by traversing the data tree This is performed during the standard data conversion but pointers as reference are left pointing to NULL A mapping from the pointer as data in the original data format to the pointer as data in the converted data format is stored together with a list of pointers as reference in the original data format and the necessary mutators in the converted data format In the second stage MAUS iterates over the pointers as reference finds the appropriate pointer as data and writes the location of the pointer as data to the pointer as reference in the converte
50. aavdy 14 57 2 po 2 e V3 V3 2 fp 13 8t a xdx 5 V3 V3 0 14 58 Therefore 07 Oy SP L 4298m 14 59 14 3 Circle parameters from three points A circle in the plane z 0 may be parameterised as x Xo y Yo p 14 60 where Xo Yo is the position of the centre of the circle and p is its radius Expanding x y 2Xox 2Yoy P XZ Y 14 61 112 which implies x y 2X ox 2Yoy p X5 YS P Xi Y The circle may be parameterised a z y Ba yy K 0 where 1 oD 2 2 3 pe Xo Y B 2X0a y 2Y a0 k l These equations are readily inverted to yield P Xo 0 la Yo 0 la gt cado E 4a a P X YF 1 14 62 14 70 The equation of a circle passing through three points x yi where i 1 2 3 can be found from rL y x y 1 2 2 ti y ti y 1 0 14 71 r y ma ya 1 which can be re written as 2 2 21 2 OS Go z y 1 srity yl zi ty Ut L si ty toy y Jao yo M wlas ys yo U ylaztys z2 1 13 y3 t2 Y z3 ys 1 z3 43 ys 1 laity 23 1 13 y3 z3 ys 14 72 Comparing this relation with equation 14 63 Ly Yi 1 a xa ya 1 14 73 z3 Y3 1 zi y y 1 B w 1 14 74 3 y ys 1 a y t 1 y 2 y ro 1 14 75 r3 y3 xz 1 z y v1 Y k 3 y Ta Yal 14 76 13 Y Ta Y Noting that 2 24 2 K ea 2 a 14 77 20 2a 4a a
51. ain points in the tracking e MAUSRunAction sets up the running for a particular spill In MAUS it just reinitialises the visualisation e MAUSEventAction sets up the running for a particular inbound particle At the beginning of each event the virtual planes tracking detectors and stepping are all cleared After the event the event data is pulled into the event data from each element e MAUSTrackingAction is called when a new track is created or destroyed If keep_tracks datacard is set to True on particle creation MAUS TrackingAction writes the initial and final track position and momentum to the output data tree If keep_steps is set to True MAUSTrackingAc tion gets step data from MAUSSteppingAction and writes this also e MAUSSteppingAction is called at each step of the particle If keep_steps datacard is set to True output step data is recorded MAUSSteppingAc tion kills particles if they exceed the maximum_number_of_steps datacard MAUSSteppingAction calls the VirtualPlanes routines on each step e MAUSStackingAction is called when a new track is created prioritising particle tracking Handles killing particles based on the kinetic_energy_threshold default_keep_or_kill and keep_or_kill_particles datacards 30 Table 4 9 Monte Carlo control parameters Name Meaning General Monte Carlo controls simulation_geometry_filename simulation_reference_particle keep_tracks keep_steps check_volume_ove
52. alue of the gaussian beam_sigma_y If beam_polarisation is set to gaussian_unit_vectors the sigma y value of the gaussian beam_mean_z If beam_polarisation is set to gaussian_unit_vectors the mean z value of the gaussian beam_sigma_z If beam_polarisation is set to gaussian_unit_vectors the sigma z value of the gaussian Table 4 8 Beam definition amplitude momentum correlation Name Meaning The following cards should be defined in each beam definition a p_correlation dict magnitude The magnitude of the amplitude momentum correla tion momentum_variable Optional parameter to specify the momentum vari able W Options are energy p pz If not specified defaults to momentum_variable from longitudinal dict 27 correct energy loss and scattering in the emittance absorbers and diffuser and accurate energy deposition in the sensitive detectors and correct showering es pecially in the downstream detectors The Right Answer in this case is the one that agrees with experiment 4 2 1 Geometry There are copious comments on setting up your own geometry in the relevant chapter I only remark here that you should e Visualise the geometry e Set verbose_level to 1 so that MAUS reports the field configuration in it s output file e Check the field maps using e g bin examples make_field_map py e Set check_volume_overlaps to True to call Geant4 internal checks for geometry consistency Otherwise it is highly
53. ame tracker station and plane are collected together to form a single digit The grouping of digits are merged with any noise effects and a Gaussian smearing is applied to the total NPE to finish the digitization pro cess 95 Chapter 11 Global PID 11 1 Introduction The global PID framework is designed to use sets of PID variables to 1 use MC data to create PDFs of these variables for a range of particle hypotheses and 2 to use the PDFs as part of a log likelihood method to determine the PID of reconstructed global tracks from data The framework is designed such that new PID variables can be added as they are developed Section 1 of this document will explain how to use the PID to produce PDFs and how to perform PID on spill data contained within a Json document Section 2 will detail how these two actions are performed within the code and in Section 3 the PID variables their structure how new ones can be added to the framework and details of those already in place will be discussed This document will be updated as the PID framework and variables continue to be developed 11 1 1 Using the PID scripts 11 1 2 Producing PDFs Whilst the PID framework comes with PDFs provided in PIDhists root it is possible for a user to produce PDFs for hypotheses not included within this file The following describes how this should be done e Simulation Production of MC data for a given particle hypothesis e Global Reconstruction The
54. ard NumberNodesZGrid 500 i Number of coordintes in r in field map grid in Write mode Takes default from pnb Goon ss datacard NumberNodesRGrid 100 NumberOfSheets int Number of sheets used to calculate the field Takes default from datacard DefaultNumberOfSheets 10 Mandatory when FieldMapMode is WriteDynamic If field map mode is write FieldTolerance double dynamic this datacard controls the tolerance on errors in the field with which the field grid and the grid extent will be chosen Choose the interpolation algorithm Options are BiLinear for a linear interpo Interpolation e f i ie string lation in r and z or LinearCubic for a linear interpolation in r and a cubic Algorithm E A spline in z Default is LinearCubic IsAmalgamated bool Set to 1 to add the coil to CoilAmalgamtion parent field see below 8 0 4 FieldType FieldAmalgamation During tracking MAUS stores a list of fields and for each one MAUS checks to see if tracking is performed through a particular field map s bounding box This can be slow if a large number of fields are present One way to speed this up is to store contributions from many coils in a single CoilAmalgamation A Coil Amalgamation searches through child modules for solenoids with PropertyBool IsAmalgamated set to true If it finds such a coil it will add the field generated by the solenoid to its own field map and disable the coil 60 Property Ty
55. arger than the multipole pole Engel double Enge2 double e y Joub Set the parameters C as defined in the Enge function above ase ouble EngeN double 8 0 13 FieldType MagneticFieldMap Reads or writes a magnetic field map in a particular region Two sorts of field maps are supported either a 2d field map in which cylindrical symmetry is assumed or a 3d field map For 2d field maps MAUS reads or writes a file that contains informa tion about the radial and longitudinal field components This is intended for solenoidal field maps where only radial and longitudinal field components are present Note that in write mode MAUS assumes cylindrical symmetry of the fields In this case MAUS writes the x and z components of the magnetic field at points on a grid in z and z Fields with an electric component are excluded from this summation For 3d field maps MAUS reads a file that contains the position and field in cartesian coordinates and performs a linear interpolation This requires quite large field map files the file size can be slightly reduced by using certain sym metries as described below It is currently not possible to write 3d field maps Property Type Description FieldMap Mode string Set to Read to read a field map and Write to write a field map FileName string The file name that is used for reading or writing The file format Supported options in Read mode are MAUStext MAUSbinary FileType string
56. at the start and end of the run and distinguished by the maus_event_type branch in the root The structure of a MAUS output file is shown below 10 Table 2 1 I O control variables Name Meaning input_root_file_name output_root_file_name end_of_run_output _root_directory output_root_file_mode Set the file name used for reading input files by In putCppRoot module Set the file name used for writing output files by OutputCppRoot module Set target directory for end of run file placement The user must ensure that this directory exists or MAUS will throw an exception Controls how root files are handled across mul tiple run numbers Set to one_big_file to put everything into one big file with file name given by output_root_file_name Set to one_file_per_run to split the filename by the trailing and insert the run number for each run For example output root would become output_999 root for run number 999 Set to end_of_run_file_per_run to place in a directory specified by end_of_run_output_root_directory Data from each run will be placed in a sub directory specified by the run number and a file specified by the output_root_file_name within that directory MAUS will create the run number directory if one does not exist but not the end_of_run_output_root_directory So in the example above if end_of_run_output_root_directory is end_of_run files will be placed like end_of_run 999 output root input
57. be obtained from equation 10 16 or 10 17 82 Figure 10 9 Right panel Fibre arrangement in station 5 of tracker 1 Left panel Fibre arrangement in the rest of the stations The shaded region shows the intersection of the three channels is triangle for every station other than station 5 where itwill be an hexagon Triplet space points As shown in figure the fibres layout is of one of two types In one case right panel of figure 10 9 the centre of the channels one in each of the three views cross intersect at a single point In this case the position of the crossing can be calculated as described in section 10 4 2 When the area of overlap of the three channels forms a triangle figure left panel the centre of area of overlap is given by 2 T zp sand 10 24 g 0 10 25 10 4 3 Pattern recognition Straight line pattern recognition In the absence of a magnetic field the tracks passing through the tracker may be described using a straight line in three dimensions Taking the z coordinate as the independent parameter the track parameters may be taken to be To via 10 26 ty ty where Xp and yo are the position at which the track crosses the tracker reference surface ty q and ty de The track model may then be written z Xo 2tg and 10 27 Y Yo 2ty 10 28 Pattern recognition then proceeds as follows A space point is chosen in each of two stations 7 and j where 7 and j label two
58. ber of rows in the field map file z_start double Position of the grid start along the z axis z_end double Position of the grid end along the z axis z_step double Step size in z r_start double Position of the grid start along the r axis r_end double Position of the grid end along the r axis r_step double Step size in r Bz_Values double Bz field value Br_Values double Br field value g4bl3dGrid Field Map Format The file format for 3d field maps is a slightly massaged version of a file format used by another code g4beamline In this mode field maps are represented by field values on a regular cartesian 3d grid number_x_points number_y_points number_z_points global_scale X x_scale Y y_scale Z z_scale BX bx_scale BY by_scale BZ bz_scale SOanFWNHE _Values Y_Values Z_Values Bx_values By_values Bz_values 66 lt Repeat as necessary gt where text in bold indicates a value described in the following table Name Type Description number_x_points double Number of points along x axis number_y_points double Number of points along y axis number_z_points double Number of points along z axis global_scale double Global scale factor applied to all x y z and Bx By Bz values x_scale double Scale factor applied to all x values y_scale double Scale factor applied to all y values z_scale double Scale factor applied to all z values bx_scale doub
59. ble are e Info Box displays various information on the spill and run in text e Spacepoints displays spacepoint positions in x y x z and y z e Tracks displays pattern recognition tracks in x y x z and y z e XYZ calls Tracks and Spacepoints to display them both together SZ displays pattern recognition tracks in s z s being the distance swept out by a particle in the x y plane 93 10 6 2 Tracker configuration variables Variable Default Description SciFiMUXNum 7 SciFiFiberDecayConst 2 7 SciFiFiberConvFactor 3047 1 SciFiFiberTrappingEff 0 056 SciFiFiberMirrorEff 0 6 SciFiFiberTransmissionEff 0 8 SciFiMUX TransmissionEff 1 0 SciFivlpcQE 0 8 SciFivlpcEnergyRes 4 0 VLPC energy resolution MeV SciFivlpcTimeRes 0 2 VLPC time resolution ns SciFiadcFactor 6 0 SciFitdcBits 16 SciFitdcFactor 1 0 SciFinPlanes 3 SciFinStations 5 SciFinTrackers 2 SciFiNPECut 2 0 SciFiClustExcept 100 SciFi_sigma_tracker0_ station5 0 4298 Tracker 1 station 5 resolution mm SciFi_sigma_ triplet 0 3844 Spacepoint triplet resolution mm SciFi_ sigma _z 0 081 mm SciFi_sigma_duplet 0 6197 mm SciFiPRHelicalOn True Helical pattern recognition flag SciFiPRStraightOn True Straight pattern recognition flag SciFiRadiusResCut 150 0 Helix radius cut mm SciFiNTurnsCut 0 75 Cut checking turns between stations is correct SciFiMaxPt 180 0 Transverse momn upper limit cut used in pat rec SciFiMinPz 180 0 Longitudina
60. bspace Alpha_L double Longitudinal alpha for the 2d t E subspace o ae tu double Normalised angular momentum for the transverse phase space Bz double Nominal magnetic field on the reference particle The following properties are used if EllipseDefinition is set to Penn or Twiss Dispersion X double Dispersion in x x energy correlation Dispersion _Y double Dispersion in y y energy correlation DispersionPrime_X double D in x Px energy correlation DispersionPrime_ Y double D in y Py energy correlation The following properties are only relevant for generating a beam envelope RootOutput string Output file name for writing output beam envelope in ROOT binary format LongTextOutput string Output file name for writing output beam envelope in string format Output file name for writing output beam envelope in string format This ShortTextOutput string abbreviated output omits some of the fields that are present in LongTextOutput files E airing Ifa BeamType is defined this property controls the file name to which beam data is written Delta _t double Offset in time used for calculating numerical derivatives Default is 0 1 ns Delta _E double Offset in energy used for calculating numerical derivatives Default is 1 MeV E Offset in x position used for calculating numerical derivatives Default is I Delta_x double nee a Offset in x momentum used for calculat
61. centre with phase given by property ReferenceParticlePhase and gains energy over the whole cavity given by 61 property EnergyGain with tolerances set by the datacards PhaseTolerance and RFDeltaEnergyTolerance 8 0 7 Tracking Stability Around RF Cavities Usually RF cavities have little or no fringe field and this can lead to some instability in the tracking algorithms When MAUS makes a step into an RF cavity volume the tracking algorithms tend to smooth out a field in a non physical way This can be prevented by either i making the step size rather small in the RF cavity or ii forcing MAUS to stop tracking by adding a physical volume at the entrance of the RF cavity a window typically made of vacuum Doing this should improve stability of tracking 8 0 8 FieldType PillBox Sets a PillBox field in a particular region MAUS represents pillboxes using a sinusoidally varying TM010 pill box field with non zero field vector elements given by V1 1 All other fields are 0 Bg J krr cos wt E Jo krr cos wt Here J are Bessel functions and k is a constant See for example SY Lee Property Type Description Length double Length of the region in which the field is present CavityMode string Phasing mode of the cavity options are Phased Unphased and Electrostatic l Controls the field during cavity phasing options are None Electrostatic st gt gt na SA
62. cluded 100 Pass globally reconstructed MC tracks to PID Loop throhigh tracks Loop through PID variables For PID variable calculate value for track Create open corresponding histogram and fill with variable value Tf required ensure non zero bin entries and normalise Write to and save file Figure 11 4 Flow chart detailing steps taken in ReduceCppGlobaPID 11 4 PID Variables Information from the MICE detectors will be incorporated into a set of PID variables that can be used to distinguish between particle hypotheses The Global PID framework has been written such that any number of PID variables can be developed and added as necessary all represented by their own class derived from a base class 11 4 1 PID Base Class The base PID class PIDBase hh and cc contains the functions to e Create the PDFs and the files that contain them e Use the PDFs with globally reconstructed tracks e Populate the PDFs with variable values after checking that value is valid e Perform the log likelihood for an incoming globally reconstructed track after checking that value of variable for track falls within range of PDF e Calculate the value of the PID variable this is a virtual function to be defined in the derived classes 11 4 2 PID Variable Classes Each PID variable will be implemented in a derived class of the base PID class Because of how the framework is designed new variables can be added as they 101
63. considerations for handling energy deposition decays and so forth physics_model is the master control variable which tells Geant4 which physics model to use The Geant4 mindset is that Geant4 provides a library of physics processes and that the defaults are not necessarily correct for all use cases This is different to e g MARS or equivalent tools Rogers has selected QGSP_BERT as a reasonable default following recommendation from G4Beamline developers 28 The MICE beam is quite highly polarised Polarised decay is possible to do in MAUS polarised_decay and spin_tracking but it is poorly understood experimentally so it is not active by default Be aware that probably electron background estimation is wrong in MICE MAUS If the physics you wish to study includes showering effects check that you are happy with the kinetic_energy_threshold production_threshold and fine_grained_production_threshold parameters The kinetic_energy_threshold sets the minimum energy of particles that will be tracked and the production_threshold parameters control the minimum range of particles that will be produced The fine_grained_production_threshold sets the geant4 production thresh old per particle and per region Regions are defined using the MiceModule Region string property which can map several volumes to the same region fine_grained_production_threshold should be a dictionary that maps the string name of a region to another dictionary This dictiona
64. ction that takes a data object and modifies it The important difference is that Map modules have no internal state meaning that they can be run in parallel Reduce modules on 17 the other hand do have internal state This means that they can act on groups of Spills for example collecting histogram data 3 3 Inheritance In order to correctly make a module one should inherit from the correct type e Input modules should inherit from InputBase e Output modules should inherit from OutputBase e Map modules should inherit from MapBase e Reduce modules should inherit from ReduceBase Base types are defined in src common_cpp API for C modules and src common_py API for python modules 3 4 Data Mangling MAUS supports representation of the data structure in various different formats MAUS support representation in ROOT ascii string and json formats It is recommended that reconstruction routines use the ROOT format For legacy reasons MAUS supports reconstruction of data stored in ascii or json formats In python the representation i e format of the data can be changed by using the module maus_cpp converter If a module implements conversion to a specific data type the can_convert flag should be set to True otherwise MAUS will always hand data in string format In C mappers are templated to a MAUS data type The API then handles any necessary conversion to that data type and provides the appropriate python wrapper code fo
65. d a geometry using the information defined in the parent volume 6 0 6 Module Hierarchy and GEANT4 Physical Volumes MAUS enables users to place arbitrary physical volumes in a GEANT4 geom etry The formatting of MAUS is such that users are encouraged to use the GEANT4 tree structure for placing physical volumes This is a double edged sword in that it provides users with a convenient interface for building geome tries but it is not a terribly safe interface 44 Black Red Blue Black Red W i IVVrong a Blue 9 Figure 6 1 The diagram shows a schematic for a square placed inside a cylinder inside a rectangle This nesting must be replicated in the MiceModules in order for the volumes to be correctly represented by MAUS Consider the cartoon of physical volumes shown above Here there is a blue volume sitting inside a red volume sitting inside the black world volume For the volumes to be represented properly the module that represents the blue volume MUST be a child of the module that represents the red volume The module that represents the red volume MUST in turn be a child of the module that represents the black volume in this case the Configuration file What would happen if we placed the blue volume directly into the Black volume i e the Configuration file GEANT4 would silently ignore the blue volume or the red volume depending on the order in which they are added into the
66. d Boy Note that this is mandatory in all cases except BendingField double where CurvatureModel is MomentumBased when the BendingAngle and Ref erenceMomentum is used to calculate the dipole field instead FieldIndez double The field index k Height double Height of the field region Width double Width or delta radius of the field region Length double Length of the field along the bent trajectory x i Set to HardEdged to disable fringe fields Set to Enge or Tanh to use those Parres SUS models as ieecubed elsewhere Default is HardEdged Choose the model for curvature Straight forces no curvature Constant gives a constant radius of curvature StraightEnds gives a constant radius of curvature CurvatureModel string along the length of the multipole with straight end fields beyond this length MomentumBased gives radius of curvature determined by a momentum and a total bending angle Radius of curvature of the magnet in Constant or StraightEnds mode Set to ReferenceCurvature double 0 for a straight magnet Default is 0 Mea Jue Reference momentum used to calculate the radius of curvature of a dipole in MomentumBased mode Default is 0 ondaa double The angle used to calculate the radius of curvature of a dipole in Momentum Based mode Note that this is mandatory in MomentumBased mode 8 0 12 EndFieldTypes In the absence of current sources the magnetic field can be calculated from a scalar potential using the standard relation
67. d data format The code is templated to maintain full type safety during this process 16 Chapter 3 Introduction to the MAUS API This chapter introduces the MAUS API framework and looks in depth at the structure of the classes and interfaces that it comprises of Several example minimal implementations are given before a note on scalability and extending the framework 3 1 Motivation The MAUS API framework provides MAUS developers with a well defined envi ronment for developing reconstruction code while allowing independent devel opment of the backend and code sharing of common elements like error handling and data mangling 3 2 Everything starts with a Module An Module is the basic building block of the MAUS API framework Four types of module exist within MAUS e An Input module is used to create an instance of a MAUS Spill structure e An Output module is used to store an instance of a MAUS data structure e A Map module is used to modify a single Spill item This enables the reconstruction to be parallelised across multiple Maps e A Reduce module is used to act on a collection of Spills Every module has a constructor destructor a birth and a death method Input modules have an emitter function that yields a new data object Output modules have a save function that takes a data object and stores it either on disk or for example broadcasting across a socket Map modules and Reduce modules have a process fun
68. des implementations of the data conversions src common_cpp Converter ConverterFactory provides a function like TYPE2 convert lt TYPE1 TYPE2 gt TYPE1 data with implementations for each of the types This then provides explicit conversion i e where both input and output types are known src common_cpp Utils PyObjectWrapper provides functions for wrap ping all of the data types into a PyObject It also provides a function that unwraps the PyObject figures out the data type and returns a data of the appropriate type src common_cpp API PyWrapMapBase calls unwrap based on the type stored in the PyObject 20 Chapter 4 Running the Monte Carlo The simulation module provides particle generation routines GEANT4 bind ings to track particles through the geometry and routines to convert modelled energy loss in detectors into digitised signals from the MICE DAQ The Digiti sation models are documented under each detector Here we describe the beam generation and GEANT4 interface 4 1 Beam Generation Beam generation is handled by the MapPyBeamMaker module Beam genera tion is separated into two classes The MapPyBeamGenerator has routines to assign particles to a number of individual beam classes each of which samples particle data from a predefined parent distribution Beam generation is handled by the beam datacard The MapPyBeamMaker can either take particles from an external file over write existing particles in the spill
69. dicated With the mylar sheet taken to be facing up fibre channel number 1 is to the left of the central fibre The fibre channel number increases from left to right The zero of the coordinate u v or w increases measured by the doublet layer is taken to be the position of the central fibre The direction in which the coordinate measured by the double layer increases is indicated by the red arrow 77 a b B S Figure 10 5 Reference surfaces and coordinate system definitions for the dou ble layer and station a The fibres in the doublet layer are shown as the shaded circles the central channel being shaded pink The mylar layer is indicated by the solid black corrugated line The doublet layer reference surface is indi cated by the vertical straight line the arrow labelled a indicates the direction in which the coordinate measured by the doublet layer u v or w increases The direction of the zg axis is indicated b View of doublet layer looking down on the mylar layer with the optical connectors at the bottom of the figure The coordinate measured by the doublet layer u v or w is indicated by the axis labelled a The orthogonal axis i e the direction in which the fibres run is labelled 6 The origin of the a 8 coordinate system is taken to be at the centre of the circular active area Station optical connectors 10 3 Reference surfaces and coordinate systems 10 3 1 Doublet layer The double
70. different stations and j gt i Ideally i 1 and j 5 However a search of all combinations of pairs for which j i gt lis made taking the pairs in the order of decreasing separation in z i e in order of decreasing Azji zj zi Initial values for the track parameters git Init vinit hast 10 29 Init ty 83 are then calculated as follows Tj Ti J a git gt ig Sg tla 10 31 get TM and 10 32 aj Zi y yi Zn 10 33 where xi yi zi are the coordinates of space point i etc A search is then made for space points in each of the stations k between station 7 and station j The distance between the x and y coordinates of the space points in the stations k j lt k lt i and the line defined by the initial track parameters is then calculated at the reference surface of station k as follows zp tp xi zt and 10 34 Y ye yo zat 10 35 Points are accepted as part of a trial track if lx lt Ay and 10 36 Syn lt Ay 10 37 If at least one space point satisfies this selection a trial track is formed con sisting of the space points selected in stations i k and j For each trial track a straight line fit is performed to calculate the fit x X Xa TX 10 38 If the fit x satisfies 2 N 2 lt Xut 10 39 then the trial track is accepted Helix pattern recognition Helix parameters In the presence of a magnetic field
71. dividual 350 wm fibres run moving outward from the centre in the u v and w planes respectively b Detail of the arrangement of the scintillating fibres in a doublet layer The fibre spacing and the fibre pitch are indicated on the right hand end of the figure in um The pattern of seven fibres ganged for readout in a single clear fibre light guide is shown in red The sheet of Mylar glued to the doublet layer is indicated gt Vw u Z Figure 10 3 The order in which the doublet layers were glued onto the station body The station body is indicated by the solid black lines The u layer shown as the grey line was glued to the station body first The w indicated by the green line was then glued onto the outer surface of the u layer The outer doublet layer the v layer shown as the blue line was then glued onto the assembly The station reference surface and the direction of increasing z are shown as the thin black lines 76 Doublet layer mylar side up Channel 1 Channel 212 or 214 Central Fibre Fibre run to the station optical connnectors taken to be towards the bottom of the figure Figure 10 4 The order in which fibre channels groups of seven fibres are numbered The sensitive surface of the doublet layer is indicated by the solid circle The direction in which the fibres run is indicated by the vertical lines The station optical connectors are taken to be at the bottom of the figure as in
72. e for which we want the cabling and calibration date can be current or a date in YYYY MM DI TOF_calib_date_from current TOF_calib_date_from 2010 08 10 00 00 00 70 Table 9 3 TOFSpacePoint class members Name Meaning pixel_key string encoded with the TOF station plane slab slabY int encoded with the TOF station plane slab slabX int encoded with the TOF station plane slab time double calibrated space point time charge int average of the charges of the constitutent slabs charge_product dt int average of charge products of the constitutent slabs double time difference between the x and y slabs resolution Table 9 4 Data cards for TOF reconstruction Name Meaning Default TOF_trigger_station conversion 0 005 MeV TOF_findTriggerPixelCut resolution for 0 1 ns smearing the PMT time TOF_makeSpacePiontCut PMT collection 0 25 efficiency Enable_t0_correction light attenuation 1400 mm in slabs Enable_trigger Delay_correction conversion from 0 125 charge to ADC Enable_timeWalk_correction conversion from 0 025 time to TDC 71 Table 9 5 Data cards for accessing calibrations from CDB Name Meaning Default TOF_calib_date_from conversion 2010 08 10 00 00 00 TOF_cabling_date_from conversion current TOF_cabling date_from current Enable_timeWalk_correction True Enable_triggerDelay_correction True Enable_t0_correction True 9 3 Database e Constants i
73. ecial virtual detectors to examine hits in boolean volumes Property Type Description Name of the physical volume that the BooleanVolume is based on This BaseModule string volume will be placed at 0 0 0 with no rotation and all subsequent volumes will be added subtracted or intersected with this one 52 7 3 7 Volume Sphere A sphere is a spherical shell with options for opening angles to make segments Property Type Description Boolean Module1 strin The first module to add MAUS will search for the MiceModule with path MICEFILES Models Modules lt BooleanModulel gt BooleonModute Tipe spade The type of boolean operation to apply either Union Intersection or Sub traction BooleanModule1 Pos n The position of the new volume with respect to the Base volume BooleanModule1 Rot ee The rotation of the new volume with respect to the Base volume Add extra modules as required Replace N with the module number N must BooleanModuleN AN be a continuous series incrementing by 1 for each new module Note that the 8 order in which modules are added is important A B U C is different to A B UC BooleanModuleN Type string BooleanModuleNPos Hep3 Vector BooleanModuleN Rot Leps Vector Property Type Description j Hep3 The x value defines the inner radius The y value defines the outer radius of Dimensions Vector the shel
74. ed Note that the rotations applied here are rather simplistic assuming a 2D geometry in x or y plane but not both Otherwise nominal apertures will be scaled to fit in the upper portion of the plotting window Okay Update the plot in the main window with the new selection Cancel Cancel changes 105 Chapter 13 G4beamline MAUS Integration This chapter describes how to run G4beamline as a third party app with MAUS G4beamline is used to model the MICE beam line from the target to the Geneva 1 counter which is just upstream of D2 It provides a realistic beam desciption which can be used to seed downstream simulations in MAUS The user must include the mapper MapPyBeamlineSimulation py in simulate_mice py to use G4beamline to create MAUS primaries Also the mapper MapPyBeamMaker must be commented out to prevent two beams one from G4beamline and one gaussian being created The beam line settings can be controlled with the dictionary g4bl table in the MAUS datacard The default configuration variables simulate a 67 200 MeV c positive beam using the Geneva 1 counter as the interface point This can be used as input for the MAUS Step IV geometry provided by the Geometry group To generate MAUS primaries for beams of different momenta or at difference interfaces i e for different MAUS geometries these variables must be changed accordingly The output of this mapper is a json document of MAUS primaries This is passed directly to MapP
75. ere glued onto the station body is shown in figure 10 3 The u layer was glued to the station body first The doublet layer was glued such that the fibre side of the doublet layer was glued to the station body i e the mylar sheet faces away from the station body The w layer was then glued onto the outer surface of the u layer The fibre side of the w layer was glued to the mylar sheet of the u layer such that the mylar sheet of the w layer also faces away from the station body Finally the v layer was glued onto the assembly The gluing arrangement was the same as for the u and w layers i e the mylar sheet of the v layer also faces away from the station body 10 2 4 Fibre channel numbering The numbering of the groups of seven fibres ganged for readout is shown in figure 10 4 With the mylar surface facing up and with the tails leading out to the station connectors taken to be at the bottom of the figure the fibre channel increases from left to right The coordinate measured by the doublet layer u v or w is taken to increase in the same direction as the channel number The origin of the measured coordinate is taken to be at the position of the central fibre 79 Figure 10 2 a Arrangement of the doublet layers in the scintillating fibre stations The outer circle shows the solenoid bore while the inner circle shows the limit of the active area of the tracker The grey blue and green regions indicate the direction that the in
76. es generated by Fast RAD This file is ini tially written by the geometry maintainers and formatted to contain run specific information during download The GDML format has a number of benefits the files can be read via a number of already existing libraries in GEANT4 and ROOT for the purpose of independent verification and validation For example the GEANT4 exam ple extended persistancy gdml G01 was used extensively for validating the GDML files produced by Fast RAD Because it is a subset of XML the data contained in the GDML files are readily accessible through the application of the libxml2 python extension The GDML are in turn translated into the MAUS readable geometry files either by directly accessing the data using the python extension which is the method applied to the detector objects or through the use of EXtensible Stylesheet Language Transformations XSLT which applies a set of predefined transformations to the XML files The following section shall describe how to use the available executable to access and use these models 35 5 1 Geometry Download There are three executable files available to users which reside in the directory bin utilities found within your copy of MAUS The three files of interest are up load_ geometry py download _fit_geometry py and get_geometry_ids py These files do the following Upload Geometry 1 Set up the Configreader class and read the values provided by Con figurationDefa
77. f the fibre positions where the subscript i indicates the it channel The pulse height for doublet and multi channel clusters is determined by summing the pulse height of all the hits that make up the cluster The measurement vector m is defined as m 3 10 6 80 Reality Figure 10 8 Channel overlap as simulated in MAUS fine tuning reduces the error associated to doublet clusters where a is given above and in the absence of additional information P 0 The corresponding covariance matrix is given by 2 Vm a E 10 7 2 08 where g2 and 0 are the variance of a and respectively The variance on a for a single hit cluster is given by 2 2 Cp X 10 8 2 2 10 8 For a doublet cluster the variance is given by A2 2 a 10 9 a 52 10 9 where A is the length of the overlap region between neighbouring fibre channels see figure 10 8 For multi hit clusters the variance is given by 2 2 om 99 10 10 The variance of the perpendicular coordinate 3 depends on the effective length leg of the fibre see figure and Appendix and is given by 2 lg o3 o 10 11 where lop 10 12 10 4 2 Space point reconstruction This section describes the space point reconstruction the algebra by which the cluster positions are translated in to tracker coordinates and to some extent the algorithm Selection of clusters that form the space point For eac
78. file If the detector description is present in the download from CDB that detector file name is also written to the main GDML file in place of the place holder element 5 The Formatter class is called which formats the GDML files The for matting alters the schema location of these files and points them to the correct local locations of the Materials GDML file This format ting leaves the original GDMLs in the temporary cache and places the new formatted files in the download directory specified by the configuration file 6 GDMLtoMAUS is then called with the location of the new formatted files as its argument This class converts the CAD GDMLs to the MICE Module text files using the XSLT stylesheets previously de scribed and the Detector GDMLs to MICE modules using a python driven routine 36 Optional If specified in the configuration file the temporary cache location is removed along with the zip file and unzipped files Get Geometry IDs 1 Set up the Configreader class and read the val ues provided by ConfigurationDefaults py or by custom configuration files This file takes start and stop time arguments to specify a period to search the CDB 2 A CDB class object is then instantiated with the server specified in the configuration file 3 The get ids method from the CDB class is called and the python dict which is downloaded is formatted and either printed to screen or to file as specified in the configuration file Two
79. formation from MapCppTOFMCDigitizer e Digits MapCppTOFDigit MapCppTOFMCDigitizer Digits are formed from the V1724 ADCs and V1290 TDCs 69 Table 9 2 Data cards for TOF digitization Name Meaning Default TOFconversionFactor conversion 0 005 MeV TOFpmtTimeResolution resolution for smear 0 1 ns ing the PMT time TOFattenuationLength light attenuation in 1400 mm slabs TOFadcConversionFactor conversion from 0 125 charge to ADC TOFtdcConversionFactor conversion from time 0 025 to TDC TOFpmtQuantumEfficiency PMT collection effi 0 25 ciency TOFscintLightSpeed propogation speed in 170 mm ns slab e Slab Hits MapCppTOFSlabHits The SlabHits routine takes individual PMT digits and associates them to reconstruct the hit in the slab All PMT digits are considered If there are multiple hits associated with a PMT the hit which is earliest in time is taken to be the real hit Then if both PMTs on a slab have hits the SlabHit is formed The TDC values are converted to time ToftdcConversionFactor and the hit time and charge associated with the slab hit are taken to be the average of the two PMT times and charges respectively In addition the charge product of the PMT charges is also formed e Space Points MapCppTOFSpacePoints A space point pixel in the TOF is a combination of x and y slab hits All combinations of x and y slab hits in a given station are considered If the station is a trigger station an attempt is made
80. g4beamline icool g4bl3dGrid Only MAUStext is supported in Write mode Default is MAUStext 65 Property Type Description Symmetry option for g4bl3dGrid file type Options are None Dipole or alme nE Quadrupole None uses the field map as is while Dipole and Quadrupole reflect the octant between the positive z y and z axes to give an appropriate field for a dipole or quadrupole ZStep double Step size in z and r Mandatory in Write mode but not used in Read mode RStep double where step size comes from the map file ZMin double ZMazx double Upper and lower bounds in z and r Mandatory in Write mode but not used in RMin double Read mode where boundaries come from the map file RMazx double Some file formats are described below I am working towards making the file for mat more generic and hence possibly easier to use but backwards compatibility will hopefully be maintained MAUStext Field Map Format The native field map format used by MAUS in text mode is described below GridType Uniform N number_rows Z1 z_start Z2 z_end dZ z_step Rl r_start R2 r_end dR r_step Bz_Values Br_Values lt Repeat as necessary gt In this mode field maps are represented by field values on a regular 2d grid that is assumed to have solenoidal symmetry i e cylindrical symmetry with no tangential component Name Type Description number_rows double Num
81. h particle event the clusters found within each doublet layer are ordered by fibre channel number Taking each station in turn an attempt is made to 81 generate a space point using all possible combinations of clusters The three clusters one each from views u v and w that make up a space point satisfy n tn An ngtngtng 10 13 where n n and n are the fibre numbers of the clusters in the u v and w views respectively and nj nj and ny are the respective central fibre numbers see Appendix 14 1 A triplet space point is selected if ne n n ngtngt ng lt K 10 14 Once all triplet space points have been found doublet space points are created from pairs of clusters from different views Crossing position calculation Doublet space points The position of the doublet space point in station coordinates r is given by r t 10 15 R 10 16 igp Ro pM2 10 17 where the measurement vector corresponding to the it cluster i m las 10 18 10 18 and the rotation matrix R gp Be defined in section 10 4 1 The simultaneous equations 10 16 and 10 17 contain two unknowns 6 and B2 Equations 10 16 and 10 17 may be rewritten m Rep Esp 10 19 Defining G II 1 EspiEspz 10 20 ott ee 10 21 Equations 10 16 and 10 17 may be solved to yield Bg 017 10 10 22 512 By 2102 2282 10 23 The position of the space point may now
82. iated detector systems The modular system described in the API section makes MAUS suitable for use by any accelerator or detector group wishing to perform simulation or reconstruction work 1 2 Getting the Code and Installing MAUS Installation is described in a separate document available at http micewww pp rl ac uk projects maus wiki Install 1 3 Citing MAUS MAUS should be cited according to the guidelines in the file CITATION 1 4 Running MAUS MAUS contains several applications to perform various tasks Two main appli cations are provided bin simulate_mice py makes a Monte Carlo simulation of the experiment and bin analyze_data_offline py reconstructs an existing data file Start a clean shell and move into the top level MAUS directory Then type gt source env sh gt MAUS_ROOT_DIR bin simulate_mice py gt MAUS_ROOT_DIR bin analyze_data_offline py 1 4 1 Run Control The routines can be controlled by a number of settings that enable users to specify run configurations as specified in this document Most control variables can be controlled directly from the comamnd line for example doing gt MAUS_ROOT_DIR bin simulate_mice py simulation_geometry_filename Test dat to run the Monte Carlo against a given geometry As another example it is possible to run the data reconstruction against a given run gt cd MAUS_ROOT_DIR gt MAUS_ROOT_DIR bin analyze_data_offline py daq_data_file 02873
83. ids ex ecutable Run number will download the geometry along with control room information for specified run including the beam line currents Set the number of the run to be down loaded Set the number of the geometry ID to be downloaded Set to True in order to cleanup the tem porary files created during the download process These are the zip file down loaded and the original GDML files from this zip file Set the G4 step max number which will be set in the ParentGeometryFile This relates to the size of steps carried out during the simulation Name of the web service used for up loads For developers use only Set the the directory which stores the Fast RAD produced GDML files which will be stored on the CDB For Develop ers use only Write the description of the geometry which is going to be uploaded This should describe what is in the beam line specifically what is new to the model It should also include any other infor mation the developer wishes the user to know For developers use only Set the date time format of the date when this geometry about to be up loaded is valid from For developers use only Set to True in order to cleanup the tem p rary files created during the upload process These are the file containing the list of GDMLs to be uploaded and also the original GDML files For devel opers use only Set the start time of the period which you would like to get the ids from the configuration da
84. ing numerical derivatives Default is I Delta _ Px double MeV c Deltas 4 double Ta in y position used for calculating numerical derivatives Default is I Delta Py double Offset in y momentum used for calculating numerical derivatives Default is I MeV c Max_Delta_t double Max_Delta_E doubl AA lea Maximum offsets when polyfit algorithm is used In some cases the offset can Max_Delta_x double as keep increasing without limit unless these maximum offsets are defined Default Max_Delta_ Px double Eo is no limit Max_Delta_y double Max_ Delta Py double The following properties are only relevant for generating a particle beam If set to true and the datacard FirstParticlelsReference is set to 0 the first event in the Module will be used as the reference particle that sets cavity O Boel phases This particle will then have the mean trajectory ie no gaussian distribution A If the BeamType is ICOOL Turtle MAUS PrimaryGenHit or G BeamLine BeamFile string Se this property defines the name of the file containing tracks for MAUS Set the maximum number of events to take from this module If other modules are defined MAUS will iterate over the modules until it the datacard numEvts NumberOfEvents int is reached or all modules have been run to NumberOfEvents Default is for MAUS to keep tracking from the first module it finds until numEvts is reached 56 Property Type
85. l The z value is not used Hep3 The x value defines the start opening angle in phi The y value defines the Phi Vector end opening angle The z value is not used Phi values must be in the range 0 to 360 degrees If undefined defaults to the range 0 360 degrees Hes The x value defines the start opening angle in theta The y value defines the Theta Vector end opening angle The z value is not used Theta values must be in the range 0 to 180 degrees If undefined defaults to the range 0 360 degrees 7 4 Repeating Modules It is possible to set up a repeating structure for e g a repeating magnet lattice The RepeatModule property enables the user to specify that a particular module will be repeated a number of times with all properties passed onto the child module but with a new position orientation and scale factor Each successive repetition will be given a translation and a rotation relative to the coordinate system of the previous repetition enabling the construction of circular and straight accelerator lattices Additionally successive repetitions can have fields scaled relative to previous repetitions enabling for example alternating lattices Property Type Description RepeatModule bool Set to 1 to enable repeats in this module NumberOfRepeata int Sey of times the module will be repeated in addition to the initial place E Translation Hep3 Translation applied to successive repeats applied in the co
86. l momn lower limit cut used in pat rec SciFiPerChanFlag 0 SciFiNoiseFlag 1 5 SciFiCrossTalkSigma 50 0 SciFiCrossTalkAmplitude 1 5 SciFiDarkCountProababilty 0 017 Probability of dark count due to thermal electrons SciFiChannelCalibList Channel calibration data location SciFiParams_Z 5 61291 SciFiParams Plane Width 0 6523 SciFiParams Radiation_Legth 424 0 SciFiParams Density 1 06 SciFiParams Mean Excitation_Energy 68 7 SciFiParams A 104 15 SciFiParams Pitch 1 4945 SciFiParams Station Radius 160 SciFiParams RMS 370 SciFiSeedCovariance 1000 Error estimate for seed values of the Kalman fit SciFiKalman_use_MCS True Flag to add multiple scattering to the Kalman fit SciFiKalman use_Eloss True Flag to add energy loss to the Kalman fit SciFiUpdateMisalignments False Do a misalignment search and update SciFiKalmanVerbose False Dump information per fitted track 94 10 7 The Monte Carlo The tracker Monte Carlo can be run using the script at the beginning of the tracker section In addition to the basic Monte Carlo noise from dark count in the VLPCs can be simulated by including the mapper MapCppTrackerMCNoise which should be run before MapCppTrackerMCDigitization Reconstruction after digitization is agnostic to source by design decision 10 7 1 Station Geometry The tracker geometry is built in Geant4 on a fibre by fibre basis The size of the active tracker plane and the fibre diameter is defined in the mice modules The fibre offset
87. le Scale factor applied to all Bx values by_scale double Scale factor applied to all By values bz_scale double Scale factor applied to all Bz values X_Values double List column of each x value Y_Values double List column of each y value Z_Values double List column of each z value Bx_Values double List column of each Bx value By_Values double List column of each By value Bz_Values double List column of each Bz value 67 Chapter 9 TOF Detector This chapter describes the time of flight TOF simulation and reconstruction software The simulation is designed to produce digits similar to real data and the reconstruction is agnostic about whether the digits are from simulation or data acquisition 9 1 Simulation e Geometry For the most upstream TOF TOFO to be simulated it is essential that the z where the beam starts be upstream of the detector In the standard Step VI geometry as described in Stage6 dat this is at 14200 mm and for the Step IV geometry described in Stage4 dat it is at 2773 mm The internal geometry of the TOF detector and the positioning of the slabs are defined in the MiceModules represenation The numbering convention is the same as that for the DAQ and is described in MICE Notes 251 and 286 It is worth keeping in mind the plane numbering convention since the current naming scheme is suboptimal o station refers to the TOF station TOFO TOF1 TOF2 o plane refers t
88. le_load_root_file root and then runs a toy analysis that plots digits at TOF1 for plane 0 and plane 1 This example pro duces two histograms tof1_digits_0_load_root_file pngand tof1_digits_1_load_root_file png 1 5 2 Loading ROOT Files in C Compiled Analysis Code The ROOT data structure can be loaded in C by compiling the Make file found in bin examples load_root_file_cpp Makefile This compiles the sample analysis in bin examples load_root_file_cpp load_root_file cc For example source env sh cd MAUS_ROOT_DIR bin examples python load_root_file py cd MAUS_ROOT_DIR bin examples load_root_file_cpp make clean PARA HHH make load_root_file This example performs a simple analysis against the data file generated by load_root_file py which is identical to the analysis performed by load_root_file py The executable produces two histograms tof1_digits_0_load_root_file_cpp png and tof1_digits_1_load_root_file_cpp png they should be identical to the histograms produced by load_root_file py 1 5 3 Loading ROOT Files on the ROOT Command Line One can load ROOT files from the command line using the ROOT interac tive display It is first necessary to load the MAUS class dictionary Then The TBrowser ROOT GUI can be used to browse to the desired location and interrogate the data structure interactively For example source env sh root SKK E EE k k kk k kkk k kkk kk kk Kk k kkk WELCOME to ROOT Version 5 30 03 20
89. lter the colour of positrons Set the RGB values to alter the colour of electrons Set the RGB values to alter the colour of gammas Set the RGB values to alter the colour of neutrons Set the RGB values to alter the colour of photons 34 Chapter 5 Geometry MAUS uses the on line Configuration Database to store all of its geometries These geometries have been transferred from CAD drawings which are based on the latest surveys and technical drawings available The CAD drawings are translated to a geometry specific subset of XML the Geometry Descrip tion Markup Language GDML prior to being recorded in the configuration database Translation of the CAD drawings is accomplished through the use of a commercial software package known as Fast RAD In principle this may be done using a combination of the open source software packages FreeCAD and CADMesh to translate the CAD drawings into a GEANT4 readable format but such an avenue has not yet been fully explored The CAD drawings contain the beam line elements and the positions of the detector survey points These objects are described in the GDML files using Tessellated solids to define the shapes of the physical volumes The detectors themselves are described using an independently generated set of GDML files using GEANT4 standard volumes An additional XML file is appended to the geometry description that assigns magnetic fields and associates the detectors to their locations in the GDML fil
90. m Setup setup a beam e Magnet Setup setup fields e Plot Setup setup the plot e Exit exit the GUI 12 3 Beam Setup The Beam Setup window enables the user to set beam parameters The top few cells set initial position momentum and particle type of the beam centroid also referred to as the reference particle or reference trajectory The bottom few cells set beam ellipse parameters Helper windows can be accessed to parameterise the beam ellipse using either a Penn parameterisation or a Twiss parameterisation e x y z initial position of the beam particle e px py pz initial momentum of the beam particle 103 Envelope Tool 1000 500 WN Co 0 Any E pal Jean ao L L a Su L poi pass AN 1 aa AN 4 0 500 1000 1500 2000 2500 3000 z mm bens ooo abiax foo emane a beta y 1000 0 abha y 0 0 emitance_y 10 bea roo O E 0 fo Beam Setup Magnet Setup Plot Setup Ext TA Al a i E 1 3 1 E E a o dake Pbt Apertures sal Figure 12 1 The Envelope Tool used to plot a reference trajectory through a few magnets e pid PDG ID of the beam particle This is an integer see Tab for some common particle ids e ellipse elements set the elements of the beam ellipse The matrix must be symmetric and positive definite or an error will be returned when Okay is pressed e Twiss setup the beam using a Twiss paramete
91. m or N m can be defined using and as appropriate Properties cannot be defined more than once within the same module 6 0 5 Child Modules Child Modules are defined with a position rotation and scale factor This places and rotates the child volume and any fields present relative to the parent volume Scale factor scales fields defined in the child module and any of its children Scale factors are recursively multiplicative that is the field generated by a child module will be scaled by the product of the scale factor defined in the parent module and all of its parents The child module definition looks like Module lt Module File Name gt PropertyHep3Vector Position lt x position gt lt y position gt lt z position gt lt Units gt PropertyHep3Vector Rotation lt x rotation gt lt y rotation gt lt z rotation gt lt Units gt PropertyDouble ScaleFactor lt Value gt lt Define volume dimensions and properties for this instance only gt MAUS searches for lt Module File Name gt first relative to MICEFILES Models Modules and subsequently relative to the current working directory The position and rotation default to 0 0 0 and the scale factor defaults to 1 e Volume Dimension and Properties of the child module can be defined at the level of the parent in this case these values will be used only for this instance of the module e If no file can be found MAUS will press on regardless attempting to buil
92. mally particle tracks are written in the global coordinate system although an alternate coordinate system can be defined Additional properties can be used to parameterise special virtual detectors Property Type Description ZSegmentation int PhiSegmentation int Set the number of segments in the detector in Z R or f Defaults to 1 RSegmentation int SteppingThrough bool SteppingInto bool Set to true to record tracks stepping through into out of or across the volume SteppingOutOf bool Defaults to true SteppingAcross bool Define an integer that is written to the output file to identify the station Station int Defaults to a unique integer identifier chosen by MAUS which will be different each time the same Special Virtual is placed LocalRefRotation Hep3 If set record hits relative to a reference rotation in the coordinate system of Vector the SpecialVirtual detector GlobalRefRotation Hep3 If set record hits relative to a reference rotation in the coordinate system of Vector the Configuration pE Hep3 If set record hits relative to a reference position in the coordinate system of POS Vector the SpecialVirtual detector GlobalRefPosition Hep3 If set record hits relative to a reference position in the coordinate system of Vector the Configuration 7 2 5 Virtual Detectors Virtual detectors are used to extract all particle data at a particular plane irre spective of geome
93. mon_cpp DataStructure MAUSEvent hh C with type identified by GetEventType string in JSON the top level branch always has a maus_event_type member which is a string value corresponding to the out put of MAUSEvent lt T gt GetEventType A summary of configuration cards affecting Input Output and data structure is shown below 2 1 Metadata Job metadata is stored in JobHeader and JobFooter data structures Data Run metadata is stored in RunHeader and RunFooter data structures The JobHeader is created at the start and end of an execution of the code and stores data on datacards bzr state and so forth The RunHeader is created at the start of each run and stores per run metadata such as the calibrations and cablings used One RunHeader and RunFooter is written for each process in the entire transform and merge execution structure so in multithreading mode this would yield one RunHeader and RunFooter for each Celery subprocess which runs the Input Transform and an additional RunHeader and RunFooter for the merge output process In single threaded mode a single RunHeader and RunFooter is generated The RunFooter and JobFooter are created at the end of the run and store run and job summary information For more details on writing to these metadata types and multithreading modes please see the section on API The Metadata is stored in ROOT in trees separate to the main Spill data tree In JSON these data are stored as separate lines often
94. n Layers These are all defined in src common_cpp API and src common_py API folders e IModule interface class for all modules defines birth and death e ModuleBase base class for modules includes some error handling e IInput interface class for all inputs defines emitter and inherits from IModule e InputBase base class for all inputs includes some error handling and inherits from ModuleBase and Input e IMap interface class for all inputs defines process and inherits from IModule 19 MapBase base class for all inputs includes some error handling and inherits from ModuleBase and IMap TReduce interface class for all reducers defines process and inherits from Module ReduceBase base class for all reducers includes some error handling and inherits from ModuleBase and Reduce IOutput interface class for all outputs defines save and inherits from IModule OutputBase base class for all outputs includes some error handling and inherits from ModuleBase and Output 3 7 2 C Python Wrapper src common_cpp API PyWrapMapBase is a templated class that wraps a generic map object and provides python interfaces to that map object Currently Input Reduce Output wrappers are provided by SWIG 3 7 3 Data Mangling Data mangling is handled in a variety of layers src common_cpp Converter ConverterBase provides an abstraction for conversion from one type to another src common_cpp Converter DataConverters provi
95. n Twiss mode set a emittance_1 In Twiss mode set sigma_t In gaussian mode set the RMS time sigma_p sigma_energy In gaussian uniform_time sawtooth_time mode sigma_pz set the RMS energy p pz cov t p cov t energy In gaussian mode set the covariance between p en cov t pz ergy pz and time and energy It is an error if this results in a matrix that is not positive definite eigen values positive t_start In uniform_time and sawtooth_time mode set the start time of the parent distribution t_end In uniform_time and sawtooth_time mode set the end time of the parent distribution Table 4 6 Beam definition coupling parameters Name Meaning The following cards should be defined in each beam definition coupling dict coupling_mode Set to none not implemented yet 26 Table 4 7 Beam definition polarisation Name Meaning The following cards should be defined in each beam definition beam_polarisation dict polarisation_mode If set to flat the beam is taken as unpolarised If set to gaussian_unit_vectors spin vector is given by a gaussian distribution in x y z the spin vector is then normalised to 1 before tracking beam_mean_x If beam_polarisation is set to gaussian_unit_vectors the mean x value of the gaussian beam_sigma_x If beam_polarisation is set to gaussian_unit_vectors the sigma x value of the gaussian beam_mean_y If beam_polarisation is set to gaussian_unit_vectors the mean y v
96. n is specified by the module or configuration that calls FCoil The module contains a number of properties that define the field Module SolMag Volume Tube Dimensions 263 0 347 0 210 0 mm PropertyString Material Al PropertyDouble BlueColour 0 75 PropertyDouble GreenColour 0 75 field PropertyString FieldType Solenoid PropertyString FileName focus dat PropertyDouble CurrentDensity 1 PropertyDouble Length 210 mm PropertyDouble Thickness 84 mm PropertyDouble InnerRadius 263 mm 46 Chapter 7 Geometry and Tracking MiceModule Properties In general MAUS treats physical geometry distinct from fields Fields can be placed overlapping physical objects or entirely independently of them as the user desires Properties for various aspects of the physical and engineering model of the simulation are described below This includes properties for sensitive detectors 7 1 General Properties There are a number of properties that are applicable to any MiceModule Property Type Description Material string The material that the volume is made up from Set to 1 to make the object invisible in visualisation or 0 to make the object Invisible bool he visible RedColour double GreenColour double Alter the colour of objects as they are visualised BlueColour double GaStepMax double The maximum step length that Geant4 can make in the volume Inherits values from the parent volumes G
97. n the CDB e Datacards e Routines to access 72 Chapter 10 The Trackers 10 1 Introduction 10 1 1 Overview This chapter describes the software used to simulate and reconstruct the MICE scintillating fibre trackers Section 10 2 10 3 and 10 4Jare reference sections pro viding descriptions of the official definitions reference surfaces and coordinate systems and reconstruction algorithms respectively The later sections provide descriptions of the code as implemented in MAUS A quick start guide regular users appears in below in section 10 1 2 10 1 2 Quick start guide Example scripts and datacards for the tracker reconstruction can be found in the bin user scifi directory A typical top level python file to run a simulation with tracker reconstruction is shown below import io generic python library for I O import gzip For compressed output pylint disable W0611 import MAUS def run This input generates empty spills to be filled by the beam maker later my_ input MAUS InputPySpillGenerator The mappers for to set up the simulation my_map MAUS MapPyGroup my_map append MAUS MapPyBeamMaker beam construction my_map append MAUS MapCppSimulation geant4 sim The mappers for tracker MC digitisation and recon my_map append MAUS MapCppTrackerMC Digitization my_map append MAUS MapCppTrackerRecon Specify config parameters via a datacard datacards io StringI
98. nEventArray contains an array of data each member of which corresponds to a particle event i e set of DAQ triggers and the DAQData corresponds to the raw data readout Additionally there are branches for re constructed scalars which are handled spill by spill and EMR data which also read out on the spill rather than event by event Figure 2 2 The MAUS output structure for a spill event The top label in each box is the name of the C class and the bottom label is the json branch name If a is shown this indicates that child objects are array items The MCEvent is subdivided into sensitive detector hits and some pure Monte Carlo outputs The primary that led to data being created is held in the Pri mary branch Here the random seed primary position momentum and so forth is stored Sensitive detector hits have Hit data energy deposited position mo mentum etc and a detector specific Channelld that represents the channel of the detector that was hit e g for TOF this indexes the slab plane and station Virtual hits are also stored these are not sensitive detector hits rather output position momenta etc of particles that cross a particular plane in space time or proper time is recorded Note virtual hits do not inherit from the Hit class and have a slightly different data structure The ReconEvent and DAQEvents are subdivided by detector ReconEvents contain reconstructed particle data for each detector and the trigger There i
99. nerated in each spill Dict containing the reference particle definition Dict defining the longitudinal phase space distri bution Dict defining the longitudinal phase space distri bution Dict defining any correlations between transverse and longitudinal Optional dict defining the polarisation of the beam If this dict is not included the beam is taken to be unpolarised Optional dict that defines a correlation between transverse amplitude and longitudinal momen tum If this dict is not included no such corre lation is introduced 24 Table 4 3 Beam distribution reference definition Name Meaning The following cards should be defined in each beam definition reference dict position dict with elements x y and z that define the reference posi tion mm momentum dict with elements x y and z that define the reference mo mentum direction Normalised to 1 at runtime particle_id PDG particle ID of the reference particle energy Reference energy time Reference time ns random_seed Set to 0 this parameter is ignored Table 4 4 Beam definition transverse parameters Name Meaning The following cards should be defined in each beam definition transverse dict transverse_mode Options are e pencil x py y py taken from reference e penn cylindrical beam symmetric in x and y e constant_solenoid cylindrical beam symmetric in x and y with beam radius calculated from on axis B
100. ng that includes the input Json filename the global_ pid_ hypothesis for which the PDF s are to be produced and a unique_ identifier typically the time and date at which the script is run is used by entering at the command line gt MAUS_ROOT_DIR bin Global pid_pdf_generator py configuration_file example_pdf_datacard py This will create a directory within MAUS_ROOT_ DIR files PID cor responding to the hypothesis and identifier given by the datacard which will then contain files for each PID variable each of which will contain the PDF for that hypothesis and variable import os A json document containing spills from MC data input_json_file_name example_hypothesis json input_json_file_type text The json document that the global tracks will be written to output_json_file_name 97 example_hypothesis_Global_Recon json output_ son _file_type text Listing 11 1 An example datacard ex_global_datacard py for use with GlobalReconImport py Other configuration flags can be added to this datacard if they need to differ from those set in ConfigurationDefaults py import os import datetime Use the current time and date as a unique identifier when creating files to contain PDFs A unique_identifier is required by the reducer and PDF production will fail without one now datetime datetime now unique_identifier now str time Y_ 4m_4dT H_M_48_4f A j
101. ning the two values as a std pair It places the same constraints on accepted tracks as those used in PIDVarA that there must be a single TOFO and TOF1 time measurement and for which the time difference between the detectors falls within the minimum and maximum set within the class will a valid value of the variable be returned The tracker must also return a valid momentum measurement for a valid variable to be returned Otherwise the value of the variable is set to 1 1 such that it falls outside of the allowed range for the variable and so variable for the track is not used in PDF production or in the PID 102 Chapter 12 The Envelope Tool The MAUS envelope tool is intended as a tool to support lattice development and enable visualisation of the MICE accelerator for online use The tool fa cilitates the visualisation of field elements propagation of particles and beams ellipses through those elements The envelope tool is intended for use with mostly straight beamlines 12 1 Example Usage To call the envelope tool with some example data source the MAUS environ ment and then do python MAUS_ROOT_DIR bin utilities envelope_tool envelope_tool py configuration_file MAUS_ROOT_DIR bin utilities envelope_tool share pseudobeamline py 12 2 Envelope Tool main window The Main Window enables the user to view the selected lattice parameters and provides buttons to update the beam lattice and plot parameters e Bea
102. nt for the same MAUS event Absolute URls URIs relative to another position in the JSON document or URIs to another MAUS event are not supported In MAUS it is necessary to make a distinction between data that is stored as a value in C and JSON value as data data that is stored as a pointer in C and a value in JSON pointer as data and data that is stored as a pointer in C and JSON to some other data in the same tree pointer as reference In the latter case the C parent object does not own the memory rather it is owned by some other object in the same tree and borrowed by the C object holding the pointer as reference The TRef and TRef Array classes provide this functionality by default never owning the memory but only storing a relevant pointer All objects referenced by a TRef or TRefArray must inherit from TObject ROOT handles all memory management while writing to and reading from ROOT files and the order of reading is unimportant as long as both reference and value have been read before the reference is used Pointers as data are converted between JSON arrays and C objects using the ObjectProcessor lt ParentType gt RegisterPointerBranch lt ChildType gt method This takes a Processor for the Child Type as an argument For C arrays vec tors the Processor argument is instead a PointerArrayProcessor lt ArrayContents gt Pointers as reference TRef and TRefArray are converted using the ObjectProcessor lt ParentType gt
103. o dimensions required Note cannot define daughter Modules for this volume type Cylinder Radius Length in z Not used leave blank Box Width in x Height in y Length along z Tube Inner Radius Outer Radius Length in z Trapezoid Half Width in x Half Height in y Half Length in z Wedge See documentation below Polycone No dimensions required Volume defined from external file Quadrupole No dimensions required Dimensions defined from module properties Multipole No dimensions required Dimensions defined from module properties Boolean No dimensions required Dimensions defined from module properties Sphere See documentation below Volume Dimension1 Dimension2 Dimension3 6 0 4 Properties Many of the features of MAUS that can be enabled in a module are described using properties For example properties enable the user to define detectors and fields Properties can be either of several types PropertyDouble Prop ertyString PropertyBool PropertyHep3Vector or PropertyInt A property is declared via lt Property Type gt lt Property Name gt lt Value gt lt Units if appropriate gt Different properties that can be enabled for Mice Modules are described else where in this document Properties of type PropertyDouble and Property Hep3Vector can have units Units are defined in the CLHEP library Units are case sensitive MAUS will return an error message if it fails to parse units Combinations of units such as T
104. o the horizontal vertical planes within a station o plane 0 means horizontal slabs slabs are oriented horizontally They measure y o plane 1 means vertical slabs slabs are oriented vertically They measure x The z locations of TOFO and TOF1 are specified in the Beamline dat file and the z of TOF2 is specified in the main geometry description file for e g Stage6 dat e Hits GEANT hits are generated for all tracks which pass through a TOF slab True TOF hits are described by the MAUS Hit class and contain the GEANT4 information prior to digitization The members of the class are listed below 68 Table 9 1 True TOF hit class members The GEANT TOF hits are encoded with the following information Name Meaning channel_id Class TOFChannelId contains station plane slab energy_deposited double energy deposited by track in the slab position ThreeVector x y z of hit at the slab momentum ThreeVector pz Py Pz of particle at slab time double hit time charge double PDG charge of particle that produced this hit track_id G4Track ID of the GEANT track that produced this hit particle_id ThreeVector PDG code of the particle that produced this hit 9 1 1 Digitization Each GEANT hit in the TOF is associated with a slab based on the geometry described in the TOF MiceModules If a hit s position does not correspond to a physical slab for instance if the hit is outside the fiducial volume
105. ole Aperturelnner Height double The inner full height of the aperture ApertureInner Width double The inner full width of the aperture Apperture OuterHeight double The outer full height of the aperture Aperture Outer Width double The outer full width of the aperture 7 3 6 Volume Boolean Boolean volumes enable several volumes to be combined to make very sophisti cated shapes from a number of elements Elements can be combined either by union intersection or subtraction operations A union creates a volume that is the sum of two elements an intersection creates a volume that covers the region where two volumes intersect each other and a subtraction creates a volume that contains all of one volume except the region that another volume sits in Boolean volumes combine volumes modelled by other MiceModules sub modules controlled using the properties listed below Only the volume shape is used position rotation and field models etc are ignored Materials colours and other relevant properties are all taken only from the Boolean Volume s properties Note that unlike in other parts of MAUS submodules for use in Booleans BaseModule BooleanModulel BooleanModule2 must be defined in a sep arate file either defined in MICEFILES Models Modules or in the working directory Also note that visualisation of boolean volumes is rather unreliable Unfor tunately this is a feature of GEANT4 An alternative technique is to use sp
106. on Global PID Figure 11 2 Steps invloved in performing the PID for a data sample import os A json document containing spills from data input_json_file_name example_hypothesis_Global_Recon json input_json_file_type text The json document that the global tracks will be written to output_json_file_name example_hypothesis_Global_PID json output_json_file_type text Listing 11 3 An example datacard example_pid_datacard py for use with GlobalPID py As the framework currently stands the output document would now contain the global tracks with the PID set where it has been possible to do so to whichever particle hypothesis had the highest log likelihood For tracks where the PID could not be determined the track PID will be left as 0 11 2 MapCppGlobalPID and ReduceCppGlobalPID 11 2 1 MapCppGlobaPID The steps taken in MapCppGlobalPID for a single track are shown in figure 11 31 To express this more fully the data having passed through the global reconstruction is then passed to the PID For each track the values of each PID variable are calculated Each of these values is then compared to the corresponding PDFs for all particle hypotheses the number of entries in the corresponding bin providing the probability from which the log likelihood is calculated For each particle hypothesis the log likelihoods of all of the PID 99 variables are summed to give a log likelihood for tha
107. ordinate system of Vector the previous repetition Repent Rotation Hep3 Rotation applied to successive repeats applied in the coordinate system of Vector the previous repetition kerea eale Facto double ad applied to successive repeats applied relative to previous repeti tion s scale factor 53 Property Type Description The RepeatModule2 property also enables the user to specify that a particu lar module will be repeated a number of times In this case MAUS will set a substitution variable RepeatNumber that holds an index between 0 and NumberOfRepeats This can be used in an expression in to provide a versatile interface between user and accelerator lattice Property Type Description RepeatModule2 bool Set to 1 to enable repeats in this module Nambe ORe int AT of times the module will be repeated in addition to the initial place 7 5 Beam Definition and Beam Envelopes The Optics application can be used to track a trajectory and associated beam envelope through the accelerator structure Optics works by finding the Jaco bian around some arbitrary trajectory using a numerical differentiation This is used to define a linear mapping about this trajectory which can then be used to transport the beam envelope A beam envelope is defined by a reference trajectory and a beam ellipse The reference trajectory takes its position and direction from the position and rotation of the module
108. osited charge time position ThreeVec mom ThreeVec used tracker number station number plane number fibre number SF Cluster used spill number event number tracker number station number plane number plane ID number number of PE digits direction ThreeVec position ThreeVec ta MC Event SF SpacePoint used spill number event number tracker number station number number of PE type clusters position ThreeVec rides 2 Spill SF Straight PR Track n_points tracker number type spacepoints Lo Ma Xz 2 Yo My Xy Recon Event SF Helical PR Track n_points tracker number type spacepoints To Yo 20 R do Yo ds 2 dz Xsz Xo Yo Xx Xhelia Tracker SF Event digits clusters spacepoints straight PR tracks helical PR tracks straight Kalman tracks helical Kalman tracks SF Track tracker number P value charge algorithm used trackpoints x XG SF TrackPoint tracker number station number plane number channel number xy PX Py PZ covariance pull residual smoothed residual x XE Figure 10 11 The tracker data structure and its position within the general MAUS data structure An asterisk indicates a vector of pointers The dotted lines indicate cross links realised as vectors of pointers 90 HVAL PS SUHA PAL WRAL Ad HPS UOTON ISUOIOY oped JUON Bed Teo WOITUSOIIY DATA
109. other python files are also present in the utilities directory process geometry py which fits formats and processes the GDML files assuming the download is complete and download_geometry py which downloads formats and processes the GDML files without applying the location fit legacy MICE module files will be used in the simulation rather than the downloaded detector geometry files because the Location fit makes this replacement To use these files the user must use the arguments in the ConfigurationDefaults py file The arguments relating to these executables are as follows 5 2 Using the Geometry Download Executables The three executables described above will allow the user to accomplish three different tasks adding a new geometry to the database checking what ge ometries are available and downloading the desired geometry The majority of users will not need to upload a new geometry At present this can only be done from the MLCR The second two operations are of primary inter est for the everyday user A list of the CAD based geometries appears at and selecting the geometry tab The user should be advised however that this list does not contain all of the infor mation necessary to run the geometry download procedure The best procedure is to use the get_ geometry_ids py executable described above For example to get all available entries in the geometry database a user should run the command from the maus root directory g
110. panel The scheme is summarised in table and figure 10 1 Table 10 1 Station numbering scheme The label of the stations that make up a MICE tracker runs from 1 to 5 The location of the station in relation to the patch panel and the absorber is reported in the column labelled Location Location Label Closest to absorber furthest from patch panel 1 2 3 4 Furthest from absorber closest to patch panel 5 74 Fibre Exit Station Station Station Station Station 5 4 3 2 1 Figure 10 1 Schematic diagram of the MICE tracker The five stations are shown supported by the carbon fibre space frame with fibres omitted for clarity The station numbering scheme is indicated together with the direction in which the clear fibre light guides leave the tracking volume 10 2 3 Doublet layer Each station consists of three doublet layers of 350 um scintillating fibres glued onto a carbon fibre station body The doublet layers are labelled u sometimes refered to also as x w and v The layers are arranged such that the fibres in one layer run at an angle of 120 to the fibres in each of the other layers as shown in figure 10 2h The arrangement of the fibres within a doublet layer is shown in figure 10 2p The configuration of the seven fibres ganged for readout via a single clear fibre light guide is also indicated Doublet layer numbering The order in which the doublet layers w
111. parameter This name is used as an expression substitution vari Parameter1_ Name string able elsewhere in the code and should start with Q See Expression Substitu tions above for details on usage of expression substitutions Parameterl Delta double Estimated initial error on the parameter Default is 1 Paramotor Hd bool Set to true to fix the parameter so that it is excluded from the optimisation Default is false Parameter Min double If required set to the minimum value that the parameter can hold Parameter Max double If required set to the maximum value that the parameter can hold Parameter2 Start iu Define an arbitrary number of parameters Parameters must be numbered con Parameter2_ Max on secutively and each parameter must have at least the start value and name Scorel double defined The optimiser will attempt to optimise against a score that is calcu Score2 lated by summing the Scorel Score2 parameters on each iteration 97 z dimension lt lt jl K gt y dimension x dimension Figure 7 1 Schematic of the geometry of a Wedge volume 58 Chapter 8 Field Properties Invoke a field using PropertyString FieldType lt fieldtype gt The field will be placed normally centred on the MiceModule Position and with the appropriate Rotation Further options for each field type are specified below and relevant datacards are also given If a fieldtype is specified some other properties mu
112. pe Description Length double The Length of the field map generated by the CoilAmalgamation RMaz double The maximum radius of the field map generated by the CoilAmalgamation Choose the interpolation algorithm Options are BiLinear for a linear interpo Interpolation f by ad it string lation in r and z or LinearCubic for a linear interpolation in r and a cubic Algorithm vont Sones spline in z Default is LinearCubic Z donuk Step size of the field map generated by the CoilAmalgamation RStep double 8 0 5 FieldType DerivativesSolenoid This is an alternative field model for solenoids that uses a power law expansion of the on axis magnetic field and its derivatives and an exponential fall off for the fringe field The fringe field is defined in the same way as other end fields but note that HardEdged end field type is not available for solenoids and will result in an error Property Type Description PeakField double Nominal peak field of the solenoid ZMaxr ole Maximum z half length of the solenoid bounding box in the local coordinate system of the magnet RMax double Maximum radius of the solenoid bounding box in the local coordinate system of the magnet MaxEndPole int Maximum derivative used in calculating the end field of the solenoid 8 0 6 Phasing Models MAUS has a number of models for phasing RF cavities When CavityMode is Unphased MAUS attempts to phase the cavity itself
113. pole Quadrupoles are defined by an empty cylinder with four further cylinders that are approximations to pole tips Property Type Description PhysicalLength double The length of the quadrupole container 51 Property Type Description QuadRadius double The distance from the quad centre to the outside of the quad PoleTipRadius double The distance from the quad centre to the pole tip CoilRadius double CoilHalfWidth double BeamlineMaterial string The material from which the beamline volume is made QuadMaterial string The material from which the quadrupole volume is made 7 3 5 Volume Multipole Multipoles are defined by an empty box with an arbitrary number of cylinders that are approximations to pole tips Poles are placed around the centre of the box with n fold symmetry Multipoles can be curved in which case poles cannot be defined only a curved rectangular aperture will be present Property Type Description ports Curate double Radius of curvature of the multipole aperture For now curved apertures cannot have poles Set to 0 for a straight aperture ApertureLength double Length of the multipole aperture NumberOfPoles int Number of poles PoleCentreRadius double distance from the centre of the aperture to the centre of the cylindrical PoleTipRadius double The distance from the centre of the aperture to the tip of the cylindrical p
114. r that module Currently only map modules support data mangling 3 5 Module Initialisation and Destruction MAUS has two execution concepts A Job refers to a single execution of the code while a Run refers to the processing of data for a MICE data run or Monte Carlo run In MAUS Inputters Mappers Reducers and Outputters are initialised at the start of every Job and destructed at the end of every Job birth for Inputters and Outputters is called at the start of every Job and death is called at the end of every Job The birth for Mappers and Reducers is called at the start of every Run and death is called at the end of every Run The logic is that for each code execution we typically want to access data from a single data source and output data to a single data file But mappers and reducers are reinitialised for each run to enable loading of new calibrations etc It is required that all transient information about the reconstruction pertaining to a run particularly ID of the calibration and cabling used is recorded in the StartOfRun data structure Any summary information on code execution 18 during the run may be stored in the EndOfRun data structure All transient information pertaining to a job for example code version or bzr branch should be recorded in the StartOfJob data structure Any summary information on code execution during the job may be stored in the EndOfJob data structure 3 6 Global Objects Object
115. re taken from the configuration defaults 1 4 2 Other Applications There are several other applications in the bin directory and associated subdi rectories e bin examples contains example scripts for accessing a number of useful features of the API e bin utilities contains utility functions that perform a number of useful utilities to do with data manipulation etc e bin user contains analysis functions that our users have found useful but are not necessarily thoroughly tested or documented e bin publications contains analysis code used for writing a particular MICE publication 1 5 Accessing Data By default MAUS writes data as a ROOT file ROOT is a widely available high energy physics data analysis library available from http root cern ch and prepacked with the MAUS third party libraries Two techniques are foreseen for accessing the data either using PyRoot python interface or using a compiled C binary Some mention of ROOT cint scripting tools is made below but this is not supported by MAUS developers beyond the most basic usage 1 5 1 Loading ROOT Files in Python Using PyROOT The standard scripting tool in MAUS is python The ROOT data structure can be loaded in python using the PyROOT package An example of how to perform a simple analysis with PyROOT is available in bin examples load_root_file py This example runs the reconstruction code to produce an output data file MAUS_ROOT_DIR tmp examp
116. resented here The first example is a geometry with no beamline elements included but with all Step IV detectors and fields in place This type of geometry has been made available to test changes in the software while avoiding the processing time necessary to load the tessellated solids used to describe the beamline The second is an idealized version of the Step IV geometry based entirely on the CAD geometry The idealized geometries are labeled with a year of 197n for the Date Valid From where n is the step number The third example is a real version of the Step I geometry with the survey information included for all detectors The CAD based geometry can be downloaded via a number of different modes The simplest way is to download the geometry by its id number From the MAUS root directory the debug geometry as described above can be down loaded with the command gt python bin utilities download_fit_geometry py geometry_download_id 22 By default the GDML files will be removed with this command If the user wishes to download the full geometry without removing the GDML files because that user wants to run a systematic study requiring reprocessing the geometry then the following command should be used 39 gt python bin utilities download_fit_geometry py geometry_download_id 24 geometry_download_clenaup F A common usage for the geometry download is to reproduce a given run To simulate a representative run from the 2013 EMR run
117. resh old per particle and per region See text Threshold for kinetic energy of new particles at production Par ticles with kinetic energy below this value will not be tracked If set to true keep parti cles with type not listed in keep_or_kill_particles If set to false kill parti Table 4 12 Visualisation control parameters Visualisation controls geant4_visualisation visualisation_viewer visualisation_theta visualisation_phi visualisation_zoom accumulate_tracks default_vis_colour pi_plus_vis_colour pi_minus_vis_colour mu_plus_vis_colour mu_minus_vis_colour e_plus_vis_colour e_minus_vis_colour gamma_vis_colour neutron_vis_colour photon_vis_colour Set to boolean true to activate GEANT4 visuali sation Control which viewer to use to visualise GEANT4 tracks Currently only vrmlviewer is compiled into GEANT4 by default Users can recompile GEANT4 with additional viewers enabled at their own risk Set the theta angle of the camera Set the phi angle of the camera Set the camera zoom Set to 1 to accumulate all of the simulated tracks into one vrml file 0 for multiple files Set the RGB values to alter the default colour of particles Set the RGB values to alter the colour of positive pions Set the RGB values to alter the colour of negative pions Set the RGB values to alter the colour of positive muons Set the RGB values to alter the colour of negative muons Set the RGB values to a
118. risation beam asymmetric in x and y with no coupling e Penn setup the beam using a Penn parameterisation beam cylindrically symmetric in x and y with angular momentum e Okay click okay to return to the main window updating the beam ellipse e Cancel click cancel to return to the main window losing changes 12 4 Magnet Setup The user can manipulate magnet parameters in this window When the window is opened MiceModules which have the following required parameters are added to the window 104 FieldType string FieldName string Position hep three vector Rotation hep three vector ScaleFactor double NominalAperture hep three vector NominalOuter hep three vector Other MiceModules will be ignored Each magnet is labelled with the magnet FieldName and a text entry is available to set the scale factor proportional to field lt field entries gt Enter a float to set the scale factor Okay Update the fields in the lattice Cancel Cancel changes 12 5 Plot Setup The Plot Setup window enables the user to select the desired plot parameters Plot Type Select the type of variable to plot Plot Variable Select the variable to plot Plot Apertures tick to plot physical apertures If the plot type is mean or envelope and plot variable is x or y the apertures will be plotted as a 2D projection of the physical apertures in the appropriate plane with the beam reference trajectory or beam envelope superimpos
119. rlaps everything_special_virtual Filename for the simulation geometry searches first in files tagged by envi ronment variable MICEFILES then in the local directory Reference particle used for phasing fields The format is as defined for a reference entry in a beam Set to boolean true to store the initial and final position momentum of each track generated by MAUS Set to boolean true to store every step generated by MAUS warning this can lead to large output files Set to a boolean value Check for over laps in volumes If an overlap is de tected Geant4 will report a warning and then quit Set to a boolean value If true all vol umes will be made special virtual and record e g energy deposited e MAUSPrimaryGeneratorAction is called at the start of every event and sets the particle data for each event In MAUS this particle generation is handled externally and so the MAUSPrimaryGeneratorAction role is to look for the primary object on the Monte Carlo event and convert this into a GEANT4 event object 31 Table 4 10 Tracking control parameters Tracking control parameters max_step_length max_track_time max_track_length maximum_number_of_steps kinetic_energy_threshold field_tracker_absolute_error field_tracker_relative_error stepping algorithm spin_tracking delta_one_step epsilon_min epsilon_max delta_intersection miss_distance Default maximum step size during
120. roperties rather than the Dimensions keyword to define the volume size Volume Trapezoid Volume Trapezoid gives a trapezoid which is not necessarily isosceles Its dimensions are given by Property Type Description Trapezoid WidthX1 Double Gives widthl in x Trapezoid WidthX2 Double Gives width2 in x Trapezoid WidthY 1 Double Gives height in y Trapezoid WidthY2 Double Gives height2 in y TrapezoidLengthZ Double Gives length along z 7 3 1 Trapezoid Volume A Trapezoid Volume is like a Wedge Volume look visualization below with the possibility to have different values for x width and 2 non zero values for y 7 3 2 Volume Wedge A wedge is a triangular prism as shown in the diagram Here the blue line extends along the positive z axis and the red line extends along the x axis Property Type Description 1 Width of the prism in x Hep3 2 Open end height of the prism in y Vector Dimensions 3 Length of the prism in z 7 3 3 Volume Polycone A polycone is a volume of rotation defined by a number of points in r and z The volume is found by a linear interpolation of the points Property Type Description Palveotelyne striae Set to Fill to define a solid volume of rotation Set to Cone to define a shell volume of rotation with an inner and outer surface FieldMapMode string The name of the file that contains the polycone data 7 3 4 Volume Quadru
121. ry Download o o o 5 2 Using the Geometry Download Executables 6 How to Define a Geometry Gin Ghee ay et eRe td LA 6 0 2 Module Files 2 2 ee ee 6 0 3 Volume and Dimensions Pra Gude in Ge Gan AA 6 0 5 Child Modules 2 00 00 0004 6 0 6 Module Hierarchy and GEANT4 Physical Volumes 6 0 7 A Sample Configuration File 6 0 8 A Sample Child Module File 7 Geometry and Tracking MiceModule Properties 7 1 General Properties o e e 7 2 Sensitive Detectorsl o 7 2 1 Scintillating Fibre Detector SciFi 7 2 2 Cerenkov Detector CKOV 7 2 3 Time Of Flight Counter TOF 7 2 4 Special Virtual Detectors 7 2 0 Virtual Detectors o 7 2 6 Envelope Detectors o o 7 3 Unconventional Volumesl 7 3 1 Trapezoid Volume o ia CMe E dira is aaa ee Lact Sunde Ss Soe a ae dde e Bob ea sa cia AE dd Liat an Garren ee eb ak ae dead aa Wa ee Sip see oe re es a de resina ira Ee Ge TE A eve ane 8 Field Properties 8 0 1 8 0 2 FieldType RectangularField 8 0 3 FieldType Solenoid 8 0 4 FieldType Field Amalgamation Field Type CylindricalField 8 0 5 FieldType DerivativesSolenold 8 0 6 Phasing Models o o
122. ry should map the string name or pdg encoded integer id in string format to the production threshold For example the entry in the datacards file might look like fine_grained_production_threshold my_region e 0 1 11 0 01 22 1 which would set production thresholds for all MiceModules in my_region to 0 1 mm for positrons 0 01 mm for electrons and use the Geant4 defaults for gammas All other particles would take their production threshold defaults from production_threshold datacard 4 3 GEANT4 Bindings The GEANT4 bindings are encoded in the Simulation module GEANT4 groups particles by run event and track A GEANT4 run maps to a MICE spill a GEANT4 event maps to a single inbound particle from the beamline and a GEANT4 track corresponds to a single particle in the experiment A number of classes are provided for basic initialisation of GEANT4 e MAUSGeant4Manager is responsible for handling interface to GEANT4 MAUSGeant4Manager handles initialisation of the GEANT4 bindings as well as accessors for individual GEANT4 objects see below Interfaces are provided to run one or many particles through the geometry returning the relevant event data The MAUSGeant4Manager sets and clears the event action before each run e MAUSPhysicsList contains routines to set up the GEANT4 physical pro cesses Datacards settings are provided to disable stochastic processes or all processes and set a few parameters In the end
123. s 7 may be used to write down the track model as xa plcos 1 and 10 42 y psing 10 43 where nfi y zi 0 yi yo 2 2p f The z coordinate is taken as a parameter since the construction of the trackers ensures that each reference surface tracker station or doublet layer is at a well defined z The distance travelled in the x y plane to reach the it point s is related to the z coordinate of the it point by ta 10 44 Si ta i 10 45 since the track is refered to the tracker reference surface The transformation from the primed to tracker coordinates is achieved with a rotation R through an angle and a translation T from zo yo to 0 0 5 r e 7 10 46 These transformations are given by E Gas ome aoa T a 10 48 10 49 where B o S l 10 50 85 Figure 10 10 Schematic diagram of track in x y plane Collecting space points in the x y plane Helix pattern recognition fol lows the same conceptual steps as the straight line pattern recognition described in section 10 4 3 A space point is chosen in each of three stations i j and k where k gt j gt 2 Ideally i 1 j 3 and k 5 However a search of all combinations of three space points for which k j gt 0 and j i gt 0 is made taking the combinations in the order of decreasing separation in z i e in order of decreasing Az Zk Zj and Azj Zj
124. s an additional branch that contains global reconstruction output that is the track fitting between detectors The data can be written in two formats The main data format is a ROOT 12 binary format This requires the ROOT package to read and write which is a standard analysis plotting package in High Energy Physics and is installed by the MAUS build script The secondary data format is JSON This is an ascii data tree format that in principle can be read by any text editor Specific JSON parsers are also available for example the python json module is available and comes prepackaged with MAUS 2 3 Image Datastructure There is a final data type that MAUS handles the Image type The Image data structure is written by ReducePyMatplotHistogram and ReducePyROOTHis togram data types Image data is only available in JSON format The data structure is shown in Fig 2 3 image_event maus_event_type keywords description data base64 encoded image image_type Figure 2 3 The MAUS output structure for an Image event The top label in each box is the name of the JSON branch and the bottom label is the data type If a is shown this indicates that child objects are array items Note there is no C implementation of Image events Each document contains a maus_event_type that should always be Image and a list of images the image data is encoded as a base 64 image and other data associa
125. s for Many Modules There are some objects that sit outside the scope of the modular framework described above Typically these are objects that do not belong to any one mod ule but need to be accessed by many Examples are the logging functionality Squeak ErrorHandler Configuration datacards field maps geometry descrip tion and Geant4 interfaces These are accessed through the static singleton class Globals defined in src common_cpp Utils Globals hh Initialisation is han dled in src common_cpp Globals GlobalsManager hh One Globals instance is initialised per subprocess when running in multiprocessing mode For python users some Global objects can be accessed by reference to the maus_cpp globals module 3 6 1 Global Object Initialisation Global objects are initialised before any modules in Go py and deleted after all modules are deathed Global object initialisation and destruction is handled at the Job level by src common_cpp Globals GlobalManager hh and called in python via maus_cpp globals as above Run by run initialisation is handled by the RunActionManager defined in src common_cpp Utils RunActionManager hh The RunActionManager holds a list of objects inheriting from RunActionBase each of which defines functions to call at the start and end of each run 3 7 Internal Classes The following classes and namespaces are used to provide an interface between reconstruction modules and the framework backend 3 7 1 Abstractio
126. sing A V mut vta 4 4 where Y is the particle phase space vector m is the particle mass and V is the ideal beam matrix defined by the transverse dict 4 2 Getting the Right Answer In MICE the code is required to get the right answer for a number of differ ence use cases MICE needs accurate stepping through the complex field maps 22 Table 4 1 Control parameters pertaining to all beam definitions Name Meaning beam dict containing beam definition parameters The following cards should all be defined within the beam dict particle_generator binomial_n binomial_p beam_file_format beam_file file_particles_per_spill random_seed definitions Set to binomial to choose the number of par ticles by sampling from a binomial distribu tion Set to counter to choose the number of particles in each beam definition explicitly Set to file to generate particles by reading an input file Set to overwrite_existing to generate particles by overwriting existing primaries When using a binomial particle_generator this controls the number of trials to make Otherwise ignored When using a binomial particle_generator this controls the probability a trial yields a particle Other wise ignored When using a file particle_generator set the input file format options are e icool_for009 e icool_for003 e g4beamline_bl_track_file e g4mice_special_hit e g4mice_virtual_hit e mars_1 e maus
127. sition of the track of Azji zj zi results in a change in and therefore s where A BOG gad 10 72 p Asji pA pl Yi 10 73 The coordinates of the track at the i station may now be written vi vb 4 Ave 10 74 where Axio Ayio Av3 Avo 10 75 0 0 AVio Ypi Yo and Axio and Ay o are obtained by evaluating Azio Y o and 10 76 Ayio Yi Yo 10 77 where 10 78 Sos 88 and The helix fit described in Appendix proceeds by minimizing N ade mg 29 y mg 9 10 80 i If the helix fit xf satisfies Nix 2N 5 then the trial track is accepted lt Xie 10 81 10 4 4 Track fit 10 5 Data structure The tracker data structure a subset of the general MAUS data structure is shown in figure 10 11 The basic unit of the MAUS data structure is the spill representing the data produced by a single actuation of the MICE target All MAUS modules mappers reducers etc act on one spill at a time The spill is then split into two sides Monte Carlo data and reconstructed data A key rule is that MC data must never be stored on the reconstruction side Each side has its own event class representing data corresponding to a single MICE particle trigger event The relationship between the spill and the MC and recon event objects is one to many Within an MC event the only data object pertaining to the tracker is the SciFiHit implemented as
128. son document containing global tracks from MC data input_json_file_name example_hypothesis_Global_Recon json input_json_file_type text The particle hypothesis that the PDF is being created for A global_pid_hypothesis is required by the reducer and PDF production will fail without one global_pid_hypothesis example HH H Listing 11 2 An example datacard example pdf datacard py for use with pid_pdf generator py Performing PID with pre existing hypotheses To perform PID on data the steps shown figure 11 2 should be followed e Data This can be experimental or MC data however the spill data must be passed to the PID in a Json document e Global Reconstruction In the same way as described above the data should then be passed through the global reconstruction currently using the GlobalReconImport py script in MAUS_ROOT_ DIR bin Global with a corresponding datacard containing the name of the input Json file and the name of the output file e Global PID To perform the PID on the reconstructed data GlobalPID py in S MAUS_ROOT_ DIR bin Global is then used This script calls the MapCppGlobalPID mapper With this script a datacard such as that shown given in listing that includes the input and output Json filenames is used by entering the following at the command line gt MAUS_ROOT_DIR bin Global GlobalPID py configuration_file example_pid_datacard py 98 Global Reconstructi
129. st also be specified while others may be optional usually taking their value from defaults specified in the datacards Only one fieldtype can be specified per mod ule However fields from multiple modules are superimposed each transformed according to the MiceModule specification This enables many different field configurations to be simulated using MAUS To use BeamTools fields datacard FieldMode Full must be set This is the default Property Type Description FieldType string Set the field type of the MiceModule 8 0 1 FieldType CylindricalField Sets a constant magnetic field in a cylindrical region symmetric about the z axis of the module Property Type Description ConstantField an The magnetic field that will be placed in the region Length double The physical extent of th i FieldRadius double sa ea a 8 0 2 FieldType RectangularField Sets a constant magnetic field in a rectangular region Property Type Description ConstantField a The magnetic field that will be placed in the region Length double Width double The physical extent of the region Height double 59 Property 8 0 3 FieldType Solenoid Type Description MAUS simulates solenoids using a series of current sheets The field for each solenoid is written to a field map on a rectangular grid and can then be reused The field from each current sheet is calc
130. t python bin utilities get_geometry_ids py get_ids_start_time 1974 01 01 00 00 00 get_ids_stop_time 2015 01 01 00 00 By default the output file is saved to MAUS_ ROOT_DIR tmp geometry_ids txt The typical output looks like the following Geometry Number 22 Geometry Note Step IV geometry consisting of the detectors only for debugging purposes Includes the TOFs Ckov EMR Tracker and KL as GDML files EMR gdml file present but not in use Beamline elements not included but fields are present for quads dipole and 37 Table 5 1 Geometry control parameters Geometry controls cdb_upload_url cdb_download_url geometry_download_wsdl geometry_download_directory geometry_download_by geometry_download_run_number geometry_download_id geometry_download_cleanup g4_step_max geometry_upload_wsdl geometry_upload_directory geometry_upload_note geometry_upload_valid_from geometry_upload_cleanup get_ids_start_time Sets the upload url relating the the Con figuration Database Sets the download url relating the the Configuration Database Name of the web service used for down loads Set the directory where you wish the ge ometry to be downloaded to This can be set to either current id or run_ number Current will download the current valid geometry stored on the CDB ID will download the geometry for the ID specified N B ID numbers can be found using the get geometry
131. t hypothesis The PID of the track is then obtained by comparing the log likelihoods of the hypotheses Get track from global reconstruction Pass reconstructed track to PID Loop through PID variables Calculate PID variable for global track Open corresponding PDFs and find number of entries likelihood for variable for all particle hypotheses Calculate log likelihood for variable For each hypothesis sum log likelihoods from PID variables Compare summed log likelihoods for each hypothesis to determine PID Figure 11 3 Flow chart detailing steps taken in MapCppGlobaPID 11 3 ReduceCppGlobalPID The steps taken in ReduceCppGlobalPID are shown in figure MC data for a given particle hypothesis having passed through the global reconstruction is then passed to the PID For each track the values of each PID variable are calculated A histogram is filled with these values If the behaviour has been turned on in the PID variable class then a single event is spread over all bins in the histogram to ensure that when the PDF is used by the PID there will no empty bins thus avoiding cases where the log likelihood takes the log of zero The histogram is then normalised to create the PDF which is then written and saved to file If a MC track returns a variable value outside of the allowed range of the histogram as defined within the variable class then the value for that track is not in
132. t layer reference surface is defined to be the flat plane that is tan gential to the outer surface of the mylar plane as shown in Figure 10 5h The measured coordinate u v w is defined to lie in this plane and the a axis is perpendicular to the direction in which the fibres run The doublet layer Zq axis is defined to to be perpendicular to the doublet layer reference surface increasing in the direction indicated in the figure The direction in which the measured coordinate increases is indicated in figure 10 5p The orthogonal coordinate in the doublet layer reference surface that with a and zg completes a right handed coordinate system is referred to as 8 The axis is also indicated in figure 10 5p 10 3 2 Station The station reference surface is defined to coincide with the reference surface of the v doublet layer see figure 10 6 The station coordinate system is defined such that the ys axis is coincident with v axis the zs axis is coincident with the zq axis of the v layer and the x axis completes a right handed coordinate system 78 Ys u w v Figure 10 6 The carbon fibre station body is indicated by the heavy solid black lines The three doublet layers are indicated by the solid grey u green w and blue v lines The station reference surface is shown by the solid vertical line coincident with the reference surface of the doublet layer labelled v The direction y axis defined to be coincident with
133. tabase Must be in solenoid Ckov files recreate MICE modules to generate incorrect conical mirror object A 180 degree rotation is applied to Tracker0 with respect to Tracker1l Survey information not included Default tracker Solenoid magnetic fields implemented with scaling to match legacy files ValidFrom Date Created 1974 02 04 19 00 00 2014 04 30 14 23 18 880000 Geometry Number 23 Geometry Note Step IV geometry with detectors including the TOFs Ckov EMR Tracker and KL included as GDML files EMR gdml file present but not in use Downstream solenoid bore gdml file has been edited to remove an appearent piece of material blocking the beam Ckov files recreate MICE modules to generate incorrect conical mirror object A 180 degree rotation is applied to Tracker0 with respect to Trackeri Survey information not included Default tracker Solenoid magnetic fields implemented with scaling as in legacy files Removed redundant objects from geometry description ValidFrom 1974 02 04 18 00 00 Date Created 2014 04 30 14 44 10 774000 Geometry Number 24 Geometry Note Step I geometry with detectors including the TOFs Ckov EMR Tracker and KL included as GDML files EMR gdml file present but not in use Ckov files recreate MICE modules to generate incorrect conical mirror object Survey information included ValidFrom 1974 02 03 18 00 00 Date Created 2014 04 30 16 05 43 553000 Three different flavors of geometry are rep
134. ted with the image is stored alongside The tag names the image while image_type describes the data format png jpeg etc OutputPyImage stores data with image_type tag as the file name description contains a description of the file and keywords describes a list of key phrases that can be used when searching 2 4 Accessing ROOT files For details on how to access the ROOT files please see the introduction section of this document 2 5 Conversion to and Working With JSON MAUS also provides output in the JSON data format This is an ascii format with IO libraries available for C Python and other languages Two utilities are provided to perform conversions bin utilities json_to_root py and bin utilities root_to_json py for conversion from and to JSON format respectively JSON Input and Output modules are provided InputPyJson and DutputPyJson An example json analysis is available in bin examples load_json_file py 2 6 Extending the Data Structure The data structure can be extended in MAUS by adding extra classes to the ex isting data structure The data classes are in src common_cpp DataStructure In order to make these classes accessible to ROOT the following steps must be taken e Add a new class in src common_cpp DataStructure e Ensure that default constructor copy constructor equality operator and destructor is present The destructor must be virtual e Add include src common_cpp Utils VersionNumber hh and a call
135. the following command should be used gt python bin utilities download_fit_geometry py geometry_download_by run_number geometry_download_r This function reads the beamline currents from the configuration database and adjusts the fields of the beamline magnets appropriately A final application is to download the latest uploaded geometry This func tion can be completed using the following command gt python bin utilities download_fit_geometry py geometry_download_by current All of these commands described will by default place the geometry in the di rectory S MAUS_ROOT_ DIR files geometry download This directory may be changed using the geometry_download_directory flag To use the down loaded geometry in the simulation the simulation_geometry_filename flag must be set to the download directory 40 Chapter 6 How to Define a Geometry Mice Modules are the objects that control the geometry and fields that are simulated in MAUS They are used in conjunction with a datacard file which provides global run control parameters Mice Modules are created by reading in a series of text files when MAUS applications are run This geometry information is used primarily by the Simulation application for tracking of particles through magnetic fields A few commands are specific to detector Reconstruction and accelerator beam Optics applications The Mice Modules are created in a tree structure Each module is a parent of any number
136. the tracks passing through the tracker may be described using a helix In tracker coordinates the tracks form circles in the x y plane Defining s to be the length of the arc swept out by the track in the x y plane a track may be described using a straight line in the s z plane Taking the z coordinate as the independent parameter the track parameters may be taken to be To Yo vex yo 10 40 ts p where zo and yo are the position at which the track crosses the tracker reference surface Yo is the azimuthal angle of the line tangent to the track in the x y 84 plane ts ds and p is the radius of curvature The angle Yo is chosen such d that do k x 10 41 where f is the unit vector in the direction Zo yo and k is the unit vector parallel to the z axis o is the unit vector tangent to the track and in the direction is defined by Yo With this definition the projection on the x y plane of a positive track propagating in the positive z direction sweeps anticlockwise Track model for pattern recognition To build up the track model con sider a track based coordinate system which has its origin at the point xo yo and in which the 2 axis is parallel to the line joining to Yo to the centre of the circle described by the track the y axis is parallel to o and the 7 axis is parallel to k see figure 10 10 A point i on the track at x y tracker coordinates at which the track direction i
137. the v axis and the z axes are shown as the solid black arrows The x axis completes a right handed coordinate system and therefore points into the page 10 3 3 Tracker The tracker reference surface is defined to coincide with the reference surface of station 1 The tracker coordinate system is defined such that the z axis coincides with the nominal axis of cylindrical symmetry of the tracker as shown in figure 10 7 The tracker 2 coordinate increases from station 1 to station 5 The tracker y axis is defined to coincide with the ys axis of station 1 and the tracker x axis completes a right handed coordinate system 10 3 4 Coordinate transformations Doublet layer to station The transformation from doublet layer to station coordinates is achieved using the rotation R oe defined by ts NY _ cosp sin p a oa Ys Espm sin0p cosp BJ 0a where 0p is the angle which the fibres that make up the doublet layer make to the x axis in the station coordinate system 10 4 Reconstruction Algorithms 10 4 1 Hits and clusters A track passing through a particular doublet layer produces scintillation light in one or at most two fibre channels For each channel hit the tracker data ac quisition system records the channel number n and the pulse height After cal ibration the pulse height is recorded in terms of the number of photo electrons 79 Figure 10 7 The outline of the components that make up the M
138. try Virtual detectors do not need to have a physical volume The plane can be a plane in z time proper time or a physical plane with some arbitrary rotation and translation 48 Property Type Description Independent Variable String e If set to t particle data will be written for particles at the time defined by the PlaneTime property e If set to tau particle data will be written for particles at the proper time defined by the PlaneTime property e Ifset to z particle data will be written for particles crossing the module s position N e If set to u particle data will be written for particles crossing a plane extending in x and y PlaneTime Double If Independent Variable is t or tau particle data will be written out at this time Mandatory if Independent Variable is t or tau RadialExtent Double If set particles outside this radius in the plane of the detector will not be recorded by the Virtual detector GlobalCoordinates Bool If set to 0 particle data is written in the coordinate system of the module Otherwise particle data is written in global coordinates MultiplePasses String Set how the VirtualPlane handles particles that pass through more than once If set to Ignore particles will be ignored on second and subsequent passes If set to SameStation particles will be registered with the same station number If set to NewStation particles will be registered
139. ulated using the formula for current sheets detailed in MUCOOL Note 281 Modeling solenoids using coil sheet and block conductors Property Type Description FileName sin Read or write solenoid data to the filename If different modules have the same filename MAUS assumes they are the same If set to Read MAUS will attempt to read existing data from the FileName If set to Write MAUS will generate new data and write it to the FileName If set to Analytic MAUS will calculate fields directly without interpolating If set to a Mode sung WriteDynamic acts as in Write except the grid extent and grid EUA at each point is chosen dynamically to some tolerance defined in the FieldTolerance property Takes default from datacard SolDataFiles Write Length double Thickness double Coil physical parameters Only used in Write Analytic mode where they are InnerRadius double mandatory CurrentDensity double Field map extends to length ZExtentFactor innerRadius in Write mode ZExtentFactor double Takes default from datacard SolzMapExtendFactor 10 Map size is chosen dynamically in WriteDynamic mode Field map extends to radius RExtentFactor innerRadius in Write mode Takes RExtentFactor double default from datacard SolrMapExtendFactor 2 018 Avoid allowing grid nodes to fall on sheets Number of coordinates in z in field map grid in Write mode Takes default Pubes Cgords me from datac
140. ults py or by custom configure files 2 Instantiate an Uploader class object using the upload directory and geometry note taken from the configuration file 3 The list of files which is created by the Uploader class is used to compress the geometry files into one zip file 4 This zip file is then used as the argument for the upload_to_CDB method which takes the contents of the zip and then uploads this as a single string to the CDB Optional If cleanup is specified in the configuration file then the file list and the original GDML files are the deleted leaving only the zip file Download Geometry 1 Set up the Configreader class and read the values provided by Con figurationDefaults py or by custom configuration files 2 Instantiate a Downloader class object and downloads either the cur rent time specified or run number zipped geometry to a temporary cache location 3 The zip file is then unzipped in this location 4 The Location Fit is called which extracts the expected positions of the detector elements the measured position of the survey points and the anticipated positions of the survey points with respect to the detector center from the GDML files The fit completes a fit with a chi square statistic to match the position of the survey nest in the detector coordinate system to its position in the hall coordinate system using a change in the position and the rotation of the detector The result is written to the GDML
141. unlikely that you will get the correct geometry 4 2 2 Tracking The principle tool that can be used to ensure a correct answer from tracking through the field maps is the step size This is controlled either from Mice Modules by setting the G4StepMax parameter per volume or from data cards by setting the max_step_length parameter Setting this parameter to a small value increases the tracking time setting it to a large value decreases the ac curacy Numerically 100 mm is found to be a reasonable value for sufficiently accurate stepping through the fields citation C Rogers thesis No one has ever studied effect of miss distance on e g some of the MICE apertures It is also wise to avoid hard field edge boundaries in the cooling channel MAUS uses by default 4th order Runge Kutta for numerical integration RK4 stepping_algorithm ClassicalRK4 For each tracking step RK4 calls the MAUS field map routines 4 times Geant4 RK4 only knows about the field value at these four points and makes some smoothing approximation at intermediate points If the geometry presents a field inhomogeneity i e a hard edged boundary it will severely degrade the stability of the tracking The way to fix this is to implement Geant4 volume boundaries on either side of the edge of any field maps This forces Geant4 to stop tracking step over the field boundary and then start tracking again 4 2 3 Energy Deposition and Showering There are a couple of other
142. urvature StraightEnds gives a constant radius of curvature CurvatureModel string along the length of the multipole with straight end fields beyond this length MomentumBased gives radius of curvature determined by a momentum and a total bending angle 63 Property Type Description Radius of curvature of the magnet in Constant or StraightEnds mode Set to ReferenceCurvature double 0 for a straight magnet Default is 0 Reference momentum used to calculate the radius of curvature of a dipole in ReferenceMomentum double MomentumBased mode Default is 0 BendinoAnole double The angle used to calculate the radius of curvature of a dipole in Momentum ca Based mode Note that this is mandatory in MomentumBased mode 8 0 11 Field Type CombinedFunction This creates superimposed dipole quadrupole and sextupole fields with a com mon radius of curvature The field is intended to mimic the first few terms in a multipole expansion of a field like PO The field index is a user defined parameter while the dipole field and radius of curvature can either be defined directly by the user or defined in terms of a reference momentum and total bending angle Fields are calculated as in the multipole field type defined above Property Type Description Pole int The reference pole of the magnet 1 dipole 2 quadrupole 3 sextupole etc The nominal dipole fiel
143. vailable PointerArrayPro cessor which converts an STL vector of pointers to data and ValueAr rayProcessor which converts an STL vector of values to data e src common_cpp JsonCppProcessors ObjectProcessor hh contains a pro cessor for object types Most of the classes in the MAUS data structure are represented in JSON as objects string value pairs where each string names a branch and each value contains data which may be another class e src common_cpp JsonCppProcessors ObjectMapProcessors hh contains a processor for converting from JSON objects to STL maps This is useful for JSON objects that contain lots of branches all of the same type A script bin user json_branch_to_data_structure_and_cpp_processor py is available that analyses a JSON object or JSON tree of nested objects and converts to C classes The script is provided as is and it is expected that developers will check the output adding comments and tests where appropriate 2 6 1 Pointer Handling MAUS can handle pointers for arrays and classes using ROOT native support via the TRef and TRefArray classes or the standard JSON reference syntax JSON references are indexed by a path relative to the root value of a JSON doc ument JSON references are formatted like URIs for example the JSON object ref spill recon_events 1 would index the second recon_event in the spill object indexing from 0 MAUS can only handle paths relative to the top level of the JSON docume
144. vel class being KalmanTrackFit Other classes used include e KalmanFilter e KalmanHelicalPropagator e KalmanStraightPropagator e KalmanState e KalmanSeed ReduceCppPatternRecognition This reducer displays spacepoints and pattern recognition tracks by tracker in the x y x z and y z projections an example being shown in figure 10 13 It also creates an InfoBox which displays various information for the spill and run such as the number of clusters spacepoints etc The plots are made using ROOT TGraphs and the InfoBox with a TPaveText Tracker 2 X Y Projection Tracker 2 Z X Projection Tracker 2 Z Y Projection mm mm 10 0 10 20 30 40 50 0 200 400 600 800 1000 1200 0 200 400 600 800 1000 1200 2 mm z mm Figure 10 13 Output from the pattern recognition reducer showing the real space projections of a three event spill in tracker 2 92 Reducer Backend The backend classes for the reducers are held in src common_cpp Plotting SciFi They consist of a reduced tracker data container class TrackerData a series of plotting class based on ROOT and a manager class TrackerDataManager used to populate the TrackerData and call the various plotters The plotters them selves inherit from a base class TrackerDataPlotterBase Each daughter class overloads the bracket operator taking in arguments of two TrackerData objects one per tracker and a ROOT TCanvas to plot on The current types availa
145. yBeamMaker py and so simulatations of the entire MICE beam line from end to end can be run However given the requisite time required to complete such a simulation this is not recommended Large scale production jobs will be run on the Grid using this mapper to create beam libraries These are publically available from details to be decided The output json document from this mapper is called G4BLoutput json and is written in whichever directory simulate_mice py was run It can be used directly with the inputter InputPyJSON py To use this include the inputter in simulate _mice py and set the path to G4BLoutput json in the MAUS datacard using the variable input_json_file_name With the beam description set as shown above a MAUS simulation with an input beam from G4beamline can be run with simulate_mice py configuration_file MAUS_Datacard py Alternatively the file downloaded from the beam library will be in the same format and can be used similarly with the same inputter 106 Table 13 1 G4BL parameters MAUS will write the following variables to the G4BL configuration file q_l q_2 q_ 3 d_1 d_s d_ 2 Field gradient of magnet particles_ per_ spill No of particles to take out of buffer for each spill if set to zero then all particles are taken from buffer for first spill run_ number When retrieving magnet currents and proton absorber thickness from CDB set to the run number of interest rotation_angle

Download Pdf Manuals

image

Related Search

Related Contents

Philips SVC3540W Precision duster  Manual del Usuario - Soundfreaq User Guides  SECO-LARM SA-025Q  Hotpoint 8211 User's Manual  46” Outdoor Freestanding Digital Poster  

Copyright © All rights reserved.
Failed to retrieve file