LISTSERV mailing list manager LISTSERV 16.5

Help for LCDET-SVN Archives


LCDET-SVN Archives

LCDET-SVN Archives


LCDET-SVN@LISTSERV.SLAC.STANFORD.EDU


View:

Message:

[

First

|

Previous

|

Next

|

Last

]

By Topic:

[

First

|

Previous

|

Next

|

Last

]

By Author:

[

First

|

Previous

|

Next

|

Last

]

Font:

Proportional Font

LISTSERV Archives

LISTSERV Archives

LCDET-SVN Home

LCDET-SVN Home

LCDET-SVN  April 2015

LCDET-SVN April 2015

Subject:

r3585 - in /projects/lcdd/branches/scintillatorHCAL: include/lcdd/detectors/ScintillatorCalorimeterHitProcessor.hh src/lcdd/detectors/HitProcessorManager.cc src/lcdd/detectors/ScintillatorCalorimeterHitProcessor.cc

From:

[log in to unmask]

Reply-To:

Notification of commits to the lcdet svn repository <[log in to unmask]>

Date:

Tue, 7 Apr 2015 23:34:52 -0000

Content-Type:

text/plain

Parts/Attachments:

Parts/Attachments

text/plain (195 lines)

Author: [log in to unmask]
Date: Tue Apr  7 16:34:46 2015
New Revision: 3585

Log:
committing first version of the ScintillatorCalorimeterHitProcessor

Added:
    projects/lcdd/branches/scintillatorHCAL/include/lcdd/detectors/ScintillatorCalorimeterHitProcessor.hh
    projects/lcdd/branches/scintillatorHCAL/src/lcdd/detectors/ScintillatorCalorimeterHitProcessor.cc
Modified:
    projects/lcdd/branches/scintillatorHCAL/src/lcdd/detectors/HitProcessorManager.cc

Added: projects/lcdd/branches/scintillatorHCAL/include/lcdd/detectors/ScintillatorCalorimeterHitProcessor.hh
 =============================================================================
--- projects/lcdd/branches/scintillatorHCAL/include/lcdd/detectors/ScintillatorCalorimeterHitProcessor.hh	(added)
+++ projects/lcdd/branches/scintillatorHCAL/include/lcdd/detectors/ScintillatorCalorimeterHitProcessor.hh	Tue Apr  7 16:34:46 2015
@@ -0,0 +1,55 @@
+#ifndef LCDD_DETECTORS_SCINTILLATORCALORIMETERHITPROCESSOR_HH_
+#define LCDD_DETECTORS_SCINTILLATORCALORIMETERHITPROCESSOR_HH_ 1
+
+// LCDD
+#include "lcdd/detectors/CalorimeterHitProcessor.hh"
+#include "lcdd/detectors/CalorimeterSD.hh"
+#include "lcdd/detectors/HitProcessorFactory.hh"
+#include "G4EmSaturation.hh"
+
+/**
+ * @brief
+ * Implementation of hit processing behavior for CalorimeterSD objects with Segmentation.
+ */
+class ScintillatorCalorimeterHitProcessor: public CalorimeterHitProcessor {
+private:
+    G4EmSaturation* m_emSaturation;
+
+public:
+
+    /**
+     * Class constructor.
+     */
+     ScintillatorCalorimeterHitProcessor();
+
+    /**
+     * Class destructor.
+     */
+    virtual ~ScintillatorCalorimeterHitProcessor();
+
+    /**
+     * Process steps to produce hits.
+     * @param[in] step A G4Step object.
+     */
+    bool processHits(G4Step* step);
+};
+
+/**
+ * @brief
+ * The factory for creating new BasicCalorimeterHitProcessor objects
+ */
+class ScintillatorCalorimeterHitProcessorFactory: public HitProcessorFactory {
+
+public:
+
+    HitProcessor* createHitProcessor() {
+        return new ScintillatorCalorimeterHitProcessor();
+    }
+
+    const std::string& handlesType() {
+        static std::string typeName = "ScintillatorCalorimeterHitProcessor";
+        return typeName;
+    }
+};
+
+#endif

Modified: projects/lcdd/branches/scintillatorHCAL/src/lcdd/detectors/HitProcessorManager.cc
 =============================================================================
--- projects/lcdd/branches/scintillatorHCAL/src/lcdd/detectors/HitProcessorManager.cc	(original)
+++ projects/lcdd/branches/scintillatorHCAL/src/lcdd/detectors/HitProcessorManager.cc	Tue Apr  7 16:34:46 2015
@@ -2,6 +2,7 @@
 
 // LCDD
 #include "lcdd/detectors/BasicCalorimeterHitProcessor.hh"
+#include "lcdd/detectors/ScintillatorCalorimeterHitProcessor.hh"
 #include "lcdd/detectors/BasicTrackerHitProcessor.hh"
 #include "lcdd/detectors/ScoringTrackerHitProcessor.hh"
 #include "lcdd/detectors/DDSegmentationCalorimeterHitProcessor.hh"
@@ -24,6 +25,7 @@
 
 void HitProcessorManager::registerDefaultFactories() {
     registerFactory(new BasicCalorimeterHitProcessorFactory());
+    registerFactory(new ScintillatorCalorimeterHitProcessorFactory());
     registerFactory(new ScoringTrackerHitProcessorFactory());
     registerFactory(new BasicTrackerHitProcessorFactory());
 

Added: projects/lcdd/branches/scintillatorHCAL/src/lcdd/detectors/ScintillatorCalorimeterHitProcessor.cc
 =============================================================================
--- projects/lcdd/branches/scintillatorHCAL/src/lcdd/detectors/ScintillatorCalorimeterHitProcessor.cc	(added)
+++ projects/lcdd/branches/scintillatorHCAL/src/lcdd/detectors/ScintillatorCalorimeterHitProcessor.cc	Tue Apr  7 16:34:46 2015
@@ -0,0 +1,88 @@
+#include "lcdd/detectors/ScintillatorCalorimeterHitProcessor.hh"
+
+// LCDD
+#include "lcdd/detectors/CurrentTrackState.hh"
+#include "lcdd/util/TimerUtil.hh"
+
+// Geant4
+#include "G4Geantino.hh"
+#include "G4ChargedGeantino.hh"
+
+ScintillatorCalorimeterHitProcessor::ScintillatorCalorimeterHitProcessor() {
+    m_emSaturation = new G4EmSaturation(0);
+}
+
+ScintillatorCalorimeterHitProcessor::~ScintillatorCalorimeterHitProcessor() {
+}
+
+bool ScintillatorCalorimeterHitProcessor::processHits(G4Step* step) {
+
+    // Get the energy deposition.
+    // G4double edep = step->GetTotalEnergyDeposit();
+    // edep with Birks' law:
+    G4double edep = m_emSaturation->VisibleEnergyDeposition(step);
+
+
+    // Mokka code:
+        // G4double energyDeposition = aStep->GetTotalEnergyDeposit();
+        //   G4double length = aStep->GetStepLength();
+        //   G4double niel = 0.; //aStep->GetNonIonisingEnergyDeposit(); //FIXME
+        //   const G4Track* track = aStep->GetTrack();
+        //   const G4ParticleDefinition* particle = track->GetDefinition();
+        //   const G4MaterialCutsCouple* couple = track->GetMaterialCutsCouple();
+        //
+        //   G4double engyVis = emSaturation->VisibleEnergyDeposition(particle,
+        //                                                            couple,
+        //                                                            length,
+        //                                                            energyDeposition,
+        //                                                            niel);
+
+    // Check for Geantino particle type.
+    G4ParticleDefinition* def = step->GetTrack()->GetDefinition();
+    bool isGeantino = false;
+    if (def == G4Geantino::Definition() || def == G4ChargedGeantino::Definition()) {
+        isGeantino = true;
+    }
+
+    // Cut on energy deposition <= cut but allow Geantinos.
+    if (edep <= _calorimeter->getEnergyCut() && isGeantino == false) {
+        return false;
+    }
+
+    // Get the Segmentation from the CalorimeterSD.
+    Segmentation* segmentation = _calorimeter->getSegmentation();
+
+    // Get the global cell position from the Segmentation.
+    G4ThreeVector globalCellPosition = segmentation->getGlobalHitPosition(step);
+
+    // Set the segmentation bin values from the step.
+    segmentation->setBins(step);
+
+    // Create a 64-bit ID from the step information.
+    Id64bit id = _calorimeter->makeIdentifier(step);
+
+    // Check for an existing hit with this identifier.
+    CalorimeterHit* hit = _calorimeter->findHit(id);
+
+    // Was there a hit found with this identifier?
+    if (hit == NULL) {
+
+        // No hit was found, so a new one is created.
+        hit = new CalorimeterHit(id, edep, globalCellPosition);
+
+        // Add the new hit to the calorimeter.
+        _calorimeter->addHit(hit, _collectionIndex);
+
+    } else {
+
+        // Add energy deposition to an existing hit.
+        hit->addEdep(edep);
+    }
+
+    // Add hit contribution to the hit.
+    // FIXME: This should pass a pointer to a new object.  It is copied, which is inefficient.
+    hit->addHitContribution(HitContribution(CurrentTrackState::getCurrentTrackID(), step));
+
+    // Return true, indicating that a hit was added or modified.
+    return true;
+}

########################################################################
Use REPLY-ALL to reply to list

To unsubscribe from the LCDET-SVN list, click the following link:
https://listserv.slac.stanford.edu/cgi-bin/wa?SUBED1=LCDET-SVN&A=1

Top of Message | Previous Page | Permalink

Advanced Options


Options

Log In

Log In

Get Password

Get Password


Search Archives

Search Archives


Subscribe or Unsubscribe

Subscribe or Unsubscribe


Archives

January 2016
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
December 2013
November 2013

ATOM RSS1 RSS2



LISTSERV.SLAC.STANFORD.EDU

Secured by F-Secure Anti-Virus CataList Email List Search Powered by the LISTSERV Email List Manager

Privacy Notice, Security Notice and Terms of Use