Photon Transport Update
Nov 12, 2003

Answers to questions from last week:

- The ND refelectors definately only cover the fibre properly. The rest of the scintillator is roughly cut, so no good optical mating exists. There is probably some reflection (10-20%) but not worth simulating. (The effect would be small) (

- The reflectivity of the ND reflector connectors is not well known. A well-polished fibre in a trial gave 70%, but she suspects the real value is closer to 50%. Leon has the mapper data, and is going to attempt an estimate sometime in the next month.

- Keith R. claims the measurement of the scintillator decay time is 7.5

- There is currently no plan to measure Birk's constant for our scintillator. Brief discussions with Mike K suggest that it might be possible, at least in principle, with CalDet data, but it's probably not very practical.


Other things fixed in the last 2 weeks:

- Went public

- K Ruddick mentioned the scintillator decay time, which I had completely left out. It is now set to 2ns (and is known to be +/- 0.5 ns)  and in all versions of the code.

- Keith also reminded me of something Jeff N said last week: the reflection is Lambertian, not isotropic.  Put this into the full model and re-ran.  When I did so, I found a bug in the way the FAST mc was being created, so this is all-round a good thing.

Here are the new plots to compare to the old ones.











- Using Robert's new plex routines, I now have a fifth pluggable module, the NoiseMaker:
Generates noise homogeneously through the detector, +/- 250 ns around all DigiScintHits.
Set to making 200 Hz of 1pe dark noise per phototube. (300 Hz/plane)
Set to making 25 Hz of 1pe noise per strip end (5000 Hz/plane)


Problems outstanding:

- Not dealing with magnet hole!
- ND still not working.. need fix from Robert.


Truthifier:
- Now saves itself in MOM.
- Now has:

  Float_t IsCandidateFromParticle(Int_t particleID, const CandHandle* candidate) const;
  Float_t IsCandidateFromTrack   (Int_t trackID, const CandHandle* candidate) const;

 template<class T>
    std::vector<const T*> GetCandidatesFromParticle(int ParticleId,
                                                    const CandHandle* list) const;
  template<class T>
    std::vector<const T*> GetCandidatesFromTrack(int TrackId,
                                                 const CandHandle* list) const;

Example: Pretty clunky, but very general.

   Truthifier& theTruth = Truthifier::Instance(mom);

   CandStripListHandle* list = ....;

 
   std::vector<CandStripHandle*> result;

   result = theTruth->GetCandidatesFromParticle<CandStripHandle>( 13, list )



Full header:
class Truthifier : public TObject
{
  ///
  /// Important note:
  ///
  /// If there's anything you want from this object
  /// please let me know and I'll put it in.
  ///
  /// --Nathaniel

 public:
  static const Truthifier& Instance(const MomNavigator* mom);

  Truthifier( const MomNavigator* mom ) { Reset(mom); };
  void Reset( const MomNavigator* mom );

  Bool_t IsValid() const { return fValid; };
  //////////////////////////////////////////////
  // Forward tracking: Particle->...->Digit

  // Hit->Signal
  const std::vector<const DigiSignal*>& GetSignalVector(const DigiScintHit* hit) const;

  // Signal->Digit
  const RawDigit*                       GetRawDigit(const DigiSignal* signal) const;

  // Hit->Signal->Digit
  const std::vector<const RawDigit*>&   GetRawDigitVector(const DigiScintHit* hit) const;

  // Track->Hit->Signal->Digit->Candidate

  // Use like this:
  // myTruthifier->GetCandidatesFromParticle<CandStripHandle>(13,CandStripListHandlePtr)

  template<class T>
    std::vector<const T*> GetCandidatesFromParticle(int ParticleId,
                                                    const CandHandle* list) const;
  template<class T>
    std::vector<const T*> GetCandidatesFromTrack(int TrackId,
                                                 const CandHandle* list) const;
  //void Test() const; // Debugging only

  //////////////////////////////////////////////
  // Backward tracking: Digit->...->Particle

  // Digit->Signal.
  const DigiSignal* GetSignal( const CandDigitHandle& cdh ) const;
  const DigiSignal* GetSignal( const RawDigit* digit ) const;

  // Some common things one would want to know:
  DigiSignal::DigiPmtTruth_t GetSignalTruthFlags( const CandDigitHandle& cdh ) const;
  DigiSignal::DigiPmtTruth_t GetSignalTruthFlags( const RawDigit* digit ) const;

  // or even simpler (as an example)
  Bool_t DigitIsOnlyCrosstalk( const CandDigitHandle& cdh ) const;
  Bool_t DigitIsOnlyCrosstalk( const RawDigit* digit ) const;

  // Signal->Hit is available from the DigiSignal class.
  Float_t IsSignalFromParticle( Int_t particleID,  const DigiSignal* signal ) const;
  Float_t IsSignalFromTrack   ( Int_t trackID,  const DigiSignal* signal ) const;

  // Digit->Hit. Some useful things
  const DigiScintHit* GetBiggestHit( const CandDigitHandle& cdh ) const;
  const DigiScintHit* GetBiggestHit( const RawDigit* digit ) const;

  Float_t IsDigitFromParticle( Int_t particleID,  const CandDigitHandle& cdh ) const;
  Float_t IsDigitFromParticle( Int_t particleID,  const RawDigit* digit ) const;

  Float_t IsDigitFromTrack( Int_t trackID,  const CandDigitHandle& cdh ) const;
  Float_t IsDigitFromTrack( Int_t trackID,  const RawDigit* digit ) const;

  Float_t IsCandidateFromParticle(Int_t particleID, const CandHandle* candidate) const;
  Float_t IsCandidateFromTrack   (Int_t trackID, const CandHandle* candidate) const;

  // Prints out the whole blessed mess.
  virtual void Print(const Option_t* = "") const;
...
}