Action #3917

Handle D2 modules with failed PMTs

Added by Knödlseder Jürgen over 2 years ago. Updated over 2 years ago.

Status:ClosedStart date:11/30/2021
Priority:NormalDue date:
Assigned To:Knödlseder Jürgen% Done:

100%

Category:-
Target version:2.0.0
Duration:

Description

Add class to handle with failed PMT information, stored in the FPM format.

The class contains coordinates for a 14 D2 modules that define a zone that should be excluded, defined by X, Y and Radius. Here some extracts from the original Fortran code:


      DO 100 ID2=1,14
        EXD2X(ID2)=0.0
        EXD2Y(ID2)=0.0
        EXD2R(ID2)=0.0
  100 CONTINUE


          OX(2)=XD2(ID2)
          OY(2)=YD2(ID2)
          OR(2)=R2
          OX(3)=EXD2X(ID2)
          OY(3)=EXD2Y(ID2)
          OR(3)=EXD2R(ID2)
C
C correct for failed PMT geometry if radius > 0.1
C
          IF(EXD2R(ID2).GT.0.1.AND.D2STAT(ID2).EQ.9)THEN
            CALL OVERLP(OSURF,OX,OY,OR)
            GMT(ID1,ID2) = GMT(ID1,ID2) - OSURF / ( PI*R1**2 )
            GMT(ID1,ID2)=MAX(0.0,GMT(ID1,ID2))
          END IF
C


C            case of event not falling in excluded region of failed PMT
C                                 MPAR(10,11) = D2(x,y) of event in mm.
             IREJ=8

             IF(D2STAT(ID2).EQ.1  .OR. 
     &         (D2STAT(ID2).EQ.9. .AND. EXD2R(ID2) .GE. 0.1. AND.
     &         (EXD2X(ID2)-MPAR(10)*.1)**2+(EXD2Y(ID2)-MPAR(11)*.1)**2
     &                         .GT.      EXD2R(ID2)**2           )
     &           )THEN

C              increment event array
               E(INDXE(ICHI,IPSI,KP)) =
     &         E(INDXE(ICHI,IPSI,KP)) + 1

C              event accepted
               IREJ=0
             ENDIF

modules_vp0221.png (587 KB) Knödlseder Jürgen, 12/01/2021 11:44 PM

modules_vp0221_lin.png (482 KB) Knödlseder Jürgen, 12/01/2021 11:44 PM

drg_fpmt0.png (277 KB) Knödlseder Jürgen, 12/02/2021 12:37 PM

drg_fpmt1.png (288 KB) Knödlseder Jürgen, 12/02/2021 12:37 PM

drg_fpmt2.png (316 KB) Knödlseder Jürgen, 12/02/2021 12:37 PM

drg_fpmt2_50.png (310 KB) Knödlseder Jürgen, 12/02/2021 01:34 PM

drg_fpmt2_100.png (309 KB) Knödlseder Jürgen, 12/02/2021 01:34 PM

drg_fpmt2_50vs25.png (211 KB) Knödlseder Jürgen, 12/02/2021 01:43 PM

drg_fpmt2_100vs25.png (209 KB) Knödlseder Jürgen, 12/02/2021 01:44 PM

e1_e2_spectra.png (220 KB) Knödlseder Jürgen, 12/02/2021 02:26 PM

etot1_etot2_spectra.png (250 KB) Knödlseder Jürgen, 12/02/2021 02:41 PM

Modules_vp0221 Modules_vp0221_lin Drg_fpmt0 Drg_fpmt1 Drg_fpmt2 Drg_fpmt2_50 Drg_fpmt2_100 Drg_fpmt2_50vs25 Drg_fpmt2_100vs25 E1_e2_spectra Etot1_etot2_spectra

Recurrence

No recurrence.

History

#1 Updated by Knödlseder Jürgen over 2 years ago

  • Target version set to 2.0.0

#2 Updated by Knödlseder Jürgen over 2 years ago

I’m actually wondering whether this functionality can be added to the GCOMStatus class since the information is always needed in parallel with the class.

First, a method

GCOMStatus::use_with_failed_pmts(const bool flag&)
could be added that instructs GCOMStatus::d2status() to return 1 for all modules that have a positive status. In that way, events for all modules will be used.

Second, the class should read an FPM file if it exists in the calibration database and deal with the relevant information. The GCOMStatus::d2status() method could be extended to

d2status(const int& tjd, const int& module, const GCOMEventAtom* event = NULL)
to optionally include the Compton event, and in case that FPM information is available, and FPM information should be used, it could set the status flag according to the event X and Y position. A method
GCOMStatus::exclude_failed_pmts(const bool flag&)
should be implemented to toggle this capability. Note that the D2 X and Y position is currently not read by GCOMEventAtom, hence the class also needs to be extended to read this information.

Third, a method

GCOMStatus::d2overlap(const int& module, const double& xd2, const double& yd2, const double& r2, const double& r1)
should be implemented that implements OSURF / ( PI*R1**2 ) in

IF.GT.0.1.AND.D2STAT.EQ.9)THEN
CALL OVERLP
GMT = GMT - OSURF / ( PI*R1**2 )
GMT=MAX)
END IF
and in particular the skydrs21.overlp() function. If exclude_failed_pmts=false the method would simply return zero. The overlap can therefore simply be subtracted from geometry in GCOMDri::compute_geometry().

#3 Updated by Knödlseder Jürgen over 2 years ago

  • Status changed from New to In Progress
  • % Done changed from 0 to 10

I implemented the reading of D2 X and Y interaction locations from the EVP file in GCOMEventList and GCOMEventAtom.

#4 Updated by Knödlseder Jürgen over 2 years ago

  • Assigned To set to Knödlseder Jürgen

#5 Updated by Knödlseder Jürgen over 2 years ago

I’m no longer sure that implementing things in GCOMStatus is actually the right thing to do since it somehow mixes things, and it still needs that flags are passed to the class.

Reading of the FPM file is also not really required, since the mission is over and the information will not evolve anymore. Hence the failed PMT positions can be hardcoded and used as function of the flag returned by GCOMStatus. Probably everything can be handled inside the GCOMDri class, which can then even write keywords about failed PMT usage in the DRI files, so that operations can be traced, and the GCOMObservation class can check the coherence between DRE and DRG.

The failed PMT handling switches can also be implemented in GCOMSelection so that a coherent handling between DRE and DRG is assured, as for other selection parameters.

#6 Updated by Knödlseder Jürgen over 2 years ago

  • % Done changed from 10 to 30
I implemented the handling of failed D2 PMTs in the GCOMSelection class, which is much more natural. A member
int m_fpmtflag;
was added that takes values between 0 and 2 with the following significance:
  • 0: all modules with failed PMTs are excluded from the DRE and DRG
  • 1: all modules with failed PMTs are included into the DRE and DRG
  • 2: events for zones around failed PMTs are excluded and the DRG is corrected correspondingly

The member can be accessed using GCOMSelection::fpmtflag() methods. The GCOMSelection::use_event() now also takes care of the module selection. Corresponding members have been added to keep track of the module selection.

The value of the m_fpmtflag member is written in the D2FPMT keyword in the DRE and DRG files. For DRE files, additional selection statistics concerning events rejected due to invalid modules are events rejected due to failed PMTs are also reported in the header.

The new logic is now used in the GCOMDri class, and specifically in the GCOMDri::compute_dre() and GCOMDri::compute_drg() methods. So far flag 2 is not yet supported since I need the zones to be excluded based on the FPM file for that. Yet I tested flag 0 (results as before) and flag 1 (including events from modules with failed PMTs), and things work as expected.

#7 Updated by Knödlseder Jürgen over 2 years ago

  • File modules_vp0221.png added

According to the module status table, here are the TJDs when the PMTs failed in a given D2 module:

TJD VP Date D2 Status value
8718 0024.0 6-4-1992 D2-13 12
8737 0026.0 25-4-1992 D2-11 16
8756 0028.0 14-5-1992 D2-14 14
8981 0204.0 25-12-1992 D2-2 11

For illustration, here is a plot of the interaction locations for VP 221 that also indicates the modules. The modules with failed PMTs appear smaller than the modules without failed PMTs. Exclusion regions from file MPE-FPM-7 are shown as black circles. D2 module 2 is actually fully excluded. The labelling of modules is for a top view. Note that the top plot is in log-scale while the bottom plot is in linear scale. The event distribution within a given module is not homogenous. Spikes of events correspond to the locations of the PMTs. A failed PMT is visible as a smearing of the corresponding spike.


#8 Updated by Knödlseder Jürgen over 2 years ago

  • Subject changed from Add GCOMFailedPMT class to Handle D2 modules with failed PMTs

#9 Updated by Knödlseder Jürgen over 2 years ago

  • File modules_vp0221_lin.png added

#10 Updated by Knödlseder Jürgen over 2 years ago

  • File modules_vp0221_lin.png added
  • File modules_vp0221.png added

#11 Updated by Knödlseder Jürgen over 2 years ago

  • File deleted (modules_vp0221.png)

#12 Updated by Knödlseder Jürgen over 2 years ago

  • File deleted (modules_vp0221_lin.png)

#14 Updated by Knödlseder Jürgen over 2 years ago

  • File deleted (modules_vp0221_lin.png)

#15 Updated by Knödlseder Jürgen over 2 years ago

  • File deleted (modules_vp0221.png)

#16 Updated by Knödlseder Jürgen over 2 years ago

I also added method to allow the selection of modules for DRI generation.

Below the DRG files for only D1 module 1 enabled using fpmtflag=0 (left), fpmtflag=1 (centre) and fpmtflag=2 for a short time interval. The binning was enhanced to 0.1° in Chi and Psi so that details of the DRG structure become visible. Note that the images are horizontally and vertically inverted with respect to the event location images shown above. Hence D2 module 2 is for example at the bottom centre.

The code operates as expected, with faulty modules excluded for fpmtflag=0 (left), all modules included for fpmtflag=1 (centre), and modules partially excluded for fpmtflag=2. Note that for the partial exclusion, D2 module 2 (at the bottom in these images) is always excluded. The three D2 modules for which events are partially excluded are at the three spots at the top-left corner.

#17 Updated by Knödlseder Jürgen over 2 years ago

I check how the steps parameter in the GCOMDri::compute_overlap() method impacts the geometry function computation. The results are shown below for steps=25 (left; default), steps=50 (centre) and steps=100 (right). The exact value does not seem to have a perceptible impact on the results.

#18 Updated by Knödlseder Jürgen over 2 years ago

To make also a quantitative comparison, here the DRG difference maps between steps=50 and steps=25 (left) and steps=100 and steps=25 (left). The increased number of integration steps becomes visible in form of lines along X and Y. The differences are indeed tiny. In term of integrated probabilities, the DRG content changes from 301387 for steps=25, to 301296 for steps=50, to 301169 for steps=100, hence a change of less than 0.1%.

#19 Updated by Knödlseder Jürgen over 2 years ago

Since I observed a lower number of counts for the D2-03 module in the 0.75-1 MeV energy band I checked whether there is an obvious module dependent energy threshold. This seems not to be the case, as illustrated below. The E1 and E2 thresholds for all events seems to be around 75 keV.

However, when plotting the total energy spectra as function of D1 and D2 module some differences become visible. Specifically, D2-02 has a significantly higher threshold, yet this module is generally excluded from the analysis (probably due to PMT failures). There are quite some variations in the total energy threshold, which may explain why the 0.75-1 MeV band is problematic.

#20 Updated by Knödlseder Jürgen over 2 years ago

  • Status changed from In Progress to Closed
  • % Done changed from 30 to 100

The handling is implemented and well verified. I close the issue now.

Also available in: Atom PDF