Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the usage of compositeAlign flag #972

Merged
merged 2 commits into from
Apr 10, 2023
Merged

Fix the usage of compositeAlign flag #972

merged 2 commits into from
Apr 10, 2023

Conversation

pbutti
Copy link
Contributor

@pbutti pbutti commented Apr 5, 2023

Closes #971

To switch off the usage of the alignable structures and run on 2016 data the sensor-level alignment use in the steering file

<compositeAlign>false</compositeAlign>
<doCOMAlignment>false</doCOMAlignment>

@tomeichlersmith tomeichlersmith linked an issue Apr 5, 2023 that may be closed by this pull request
Copy link
Collaborator

@tomeichlersmith tomeichlersmith left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While this allows me to bypass the COM-related issues, I am still getting some weirdness. Specifically, the KalmanKinkFit complains about seemingly every hit in every event. e.g.

KalmanKinkFit event 132928103, layer or module mismatch for millipedeID=4
      SiModule: layer = 5, detector = 1
      From ID:  layer = 3, detector = 1

Perhaps I am just misconfiguring. The steering file that was ran is copied below. I used the -w option to remove any uncertainty about what the command line parameters were.

Steering File
<?xml version="1.0" encoding="UTF-8"?>
<lcsim xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="http://www.lcsim.org/schemas/lcsim/1.0/lcsim.xsd">
  <!-- 
      Steering file for running KF tracking and mille alignment
      created:  Nov 2022
      @author Tom Eichlersmith <eichl008@umn.edu>
      @author PF <pbutti@slac.stanford.edu>
    -->
  <execute>
    <!-- Enable the following if re-processing lcio files -->
    <driver name="PreCleanupDriver" />
    <driver name="RfFitter" />
    <driver name="EcalRunningPedestal" />
    <driver name="EcalRawConverter" />
    <driver name="EcalTimeCorrection" />
    <driver name="ReconClusterer" />
    <driver name="CopyCluster" />
    <!-- 
        SVT reconstruction drivers 
    
        SensorSetup associates hits with sensors without having to re-decode them.
        TrackerHitDriver assocites clusters with tracker modules without having to re-cluster.
      -->
    <driver name="SensorSetup" />
    <driver name="TrackerHitDriver" />
    <!--
        Kalman tracking
      -->
    <driver name="KalmanPatRecDriver" />
    <driver name="KalmanKinkFitDriver" />
    <driver name="KalmanToGBLDriver" />
    <!--
        Use milli+GBL to prepare alignment data file for pede
      -->
    <driver name="SimpleGBLTrajAliDriverKF" />
    <!-- it has to be before GBLOutputDriver -->
    <driver name="MultEvtVtx" />
    <!--
      Write out histograms
      <driver name="GBLOutputDriverKF"/>
      -->
    <driver name="GBLOutputDriver" />
    <driver name="CleanupDriver" />
  </execute>
  <drivers>
    <driver name="PreCleanupDriver" type="org.hps.analysis.dataquality.ReadoutCleanupDriver">
      <!--Clean collections-->
      <collectionNames>KFTrackData KFTrackDataRelations KalmanFullTracks KalmanFullTracksToMCParticleRelations KallmanFullTracksToTruthTrackRelations KalmanFullTracksTruth EcalCalHits EcalClusters EcalClustersCorr FinalStateParticles UnconstrainedV0Candidates UnconstrainedV0Vertices TargetConstrainedV0Candidates TargetConstrainedV0Vertices BeamspotConstrainedV0Candidates BeamspotConstrainedV0Vertices GBLKinkData GBLKinkDataRelations MatchedToGBLTrackRelations HelicalTrackHits HelicalTrackHitRelations MatchedTracks GBLTracks MatchedToGBLTrackRelations RotatedHelicalTrackHits RotatedHelicalTrackHitRelations TrackData TrackDataRelations TrackResiduals TrackResidualsRelations RotatedHelicalTrackHits RotatedHelicalTrackHitRelations StripClusterer_SiTrackerHitStrip1D</collectionNames>
    </driver>
    <driver name="RfFitter" type="org.hps.evio.RfFitterDriver" />
    <!-- Ecal reconstruction drivers -->
    <driver name="EcalRunningPedestal" type="org.hps.recon.ecal.EcalRunningPedestalDriver">
      <logLevel>CONFIG</logLevel>
    </driver>
    <driver name="EcalRawConverter" type="org.hps.recon.ecal.EcalRawConverter2Driver">
      <!-- ecalCollectionName>EcalCalHits</ecalCollectionName -->
      <!-- fixShapeParameter>true</fixShapeParameter -->
      <!-- globalFixedPulseWidth>2.4</globalFixedPulseWidth -->
    </driver>
    <driver name="EcalTimeCorrection" type="org.hps.recon.ecal.EcalTimeCorrectionDriver" />
    <driver name="ReconClusterer" type="org.hps.recon.ecal.cluster.ReconClusterDriver">
      <logLevel>WARNING</logLevel>
      <outputClusterCollectionName>EcalClusters</outputClusterCollectionName>
    </driver>
    <driver name="CopyCluster" type="org.hps.recon.ecal.cluster.CopyClusterCollectionDriver">
      <inputCollectionName>EcalClusters</inputCollectionName>
      <outputCollectionName>EcalClustersCorr</outputCollectionName>
    </driver>
    <!-- SVT reconstruction drivers -->
    <driver name="SensorSetup" type="org.hps.recon.tracking.SensorSetup">
      <readoutCollections>SVTRawTrackerHits</readoutCollections>
      <fittedHitCollection>SVTFittedRawTrackerHits</fittedHitCollection>
    </driver>
    <driver name="TrackerHitDriver" type="org.hps.recon.tracking.DataTrackerHitDriver">
      <neighborDeltaT>8.0</neighborDeltaT>
      <saveMonsterEvents>false</saveMonsterEvents>
      <thresholdMonsterEvents>200</thresholdMonsterEvents>
      <debug>false</debug>
    </driver>
    <driver name="GBLOutputDriver" type="org.hps.recon.tracking.gbl.GBLOutputDriver">
      <nHits>6</nHits>
      <!-- minimum hits -->
      <outputPlotsFilename>events_kf_mille_gblplots.root</outputPlotsFilename>
      <bsZ>-7.5</bsZ>
      <trackCollectionName>GBLTracks</trackCollectionName>
      <!--the KF tracks refitted as GBL don't have kinks?? -->
      <doGBLkinks>false</doGBLkinks>
      <dataRelationCollection>""</dataRelationCollection>
      <chi2Cut>9999</chi2Cut>
    </driver>
    <driver name="CleanupDriver" type="org.lcsim.recon.tracking.digitization.sisim.config.ReadoutCleanupDriver" />
    <driver name="MultEvtVtx" type="org.hps.recon.vertexing.MultipleEventsVertexingDriver">
      <ntrks>100</ntrks>
    </driver>
    <driver name="KalmanPatRecDriver" type="org.hps.recon.tracking.kalman.KalmanPatRecDriver">
      <!--<doDebugPlots>false</doDebugPlots>-->
      <!-- <siHitsLimit>50</siHitsLimit> -->
      <seedCompThr>0.05</seedCompThr>
      <addResiduals>true</addResiduals>
      <verbose>true</verbose>
    </driver>
    <!-- do front-back kink plots -->
    <driver name="KalmanKinkFitDriver" type="org.hps.recon.tracking.kalman.KalmanKinkFitDriver" />
    <!-- Form trajectories for MPII using the GBL algorithm, starting from Kalman Tracks -->
    <driver name="KalmanToGBLDriver" type="org.hps.recon.tracking.gbl.KalmanToGBLDriver">
      <!--<debug>true</debug>-->
    </driver>
    <!-- Form trajectories for MPII using the GBL algorithm -->
    <driver name="SimpleGBLTrajAliDriverKF" type="org.hps.recon.tracking.gbl.SimpleGBLTrajAliDriver">
      <!-- apply the track quality cuts -->
      <enableAlignmentCuts>True</enableAlignmentCuts>
      <doCOMAlignment>False</doCOMAlignment>
      <minMom>0.5</minMom>
      <maxMom>5.0</maxMom>
      <nHitsCut>6</nHitsCut>
      <!-- minimum number of hits to be included -->
      <debugAlignmentDs>False</debugAlignmentDs>
      <correctTrack>True</correctTrack>
      <!-- refit with GBL before doing Mille -->
      <includeNoHitScatters>False</includeNoHitScatters>
      <gblRefitIterations>0</gblRefitIterations>
      <storeTrackStates>True</storeTrackStates>
      <compositeAlign>False</compositeAlign>
      <momC>4.55</momC>
      <!-- momentum constraint [GeV] -->
      <constrainedFit>False</constrainedFit>
      <!-- apply momentum constraint -->
      <constrainedBSFit>False</constrainedBSFit>
      <!-- apply beam spot constraint -->
      <bsZ>-7.7</bsZ>
      <!-- beam spot z-coordinate, used to calculate beam spot -->
      <trackSide>-1</trackSide>
      <!--hole-->
      <writeMilleBinary>true</writeMilleBinary>
      <milleBinaryFileName>events_kf_mille.bin</milleBinaryFileName>
      <!-- can't use numbers in variable substition from commandline defs -->
      <writeMilleChi2Cut>5</writeMilleChi2Cut>
      <!-- max Chi2/Ndf to be included -->
      <enableStandardCuts>False</enableStandardCuts>
      <maxTrackChisq4hits>60.0</maxTrackChisq4hits>
      <maxTrackChisq5hits>60.0</maxTrackChisq5hits>
      <maxTrackChisq6hits>60.0</maxTrackChisq6hits>
      <inputCollectionName>KalmanFullTracks</inputCollectionName>
    </driver>
    <driver name="GBLOutputDriverKF" type="org.hps.recon.tracking.gbl.GBLOutputDriver">
      <nHits>0</nHits>
      <!-- minimum hits -->
      <outputPlotsFilename>events_kf_mille_gblplots_from_kf.root</outputPlotsFilename>
      <bsZ>-7.5</bsZ>
      <trackCollectionName>KalmanFullTracks</trackCollectionName>
      <trackResidualsRelColName>TrackResidualsKFtoGBLRelations</trackResidualsRelColName>
      <!-- need to find relation collection for Kalma -->
      <doGBLkinks>false</doGBLkinks>
      <dataRelationCollection>""</dataRelationCollection>
      <chi2Cut>9999</chi2Cut>
    </driver>
  </drivers>
</lcsim>

Copy link
Collaborator

@tomeichlersmith tomeichlersmith left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright, I removed the KalmanKinkFit driver and I was able to have it run over a full file. No tracks ended up in the output millepede binary file, but I can confirm that the tracks are being constructed as can be seen in the endOfData printout from the KalmanPatRecDriver. Let's merge this as an improvement and I'll keep studying to see what cuts need to be updated.

Big phi change in event 133165104
Big phi change in event 133215633
KalmanPatRecDriver.endOfData: total pattern recognition execution time=2268651.4455 ms for 397362 events and 873378 tracks.
                              Kalman Patrec Time per event =    5.7093 ms; Time per track =    2.5976 ms
                              Kalman Patrec maximum time for one event =  1293.2151 ms
                              Kalman Interface Time per event =    0.4380 ms
KalmanInterface::summary: number of events with > 200 hits=0.
                          Maximum event size = 200 strip hits.
                          Events with > 0 hits were not processed.
                          Number of tracks with bad covariance in filterTrack= 10 1155
                          Number of tracks with bad covariance in KalTrack.fit=40 2772
Close Binary
Size of accumulated Billior tracks: 0
Fitting Vertex
n_chunks = 0
n_rest = 0
size  = 0 
n_chunks = 0
n_rest = 0
size  = 0 
n_chunks = 0
n_rest = 0
size  = 0 
org.lcsim.job:INFO Job processed 397362 events.
org.lcsim.job:INFO Job ended: Fri Apr 07 16:33:17 UTC 2023
org.lcsim.job:INFO Job took 4706.172 seconds.
org.lcsim.job:INFO Event processing took 11.843538133993688 ms/event or 84.4342280732621 events/second.

@tomeichlersmith tomeichlersmith merged commit df679ef into master Apr 10, 2023
@tomeichlersmith tomeichlersmith deleted the iss971 branch April 10, 2023 14:36
@tomeichlersmith tomeichlersmith mentioned this pull request Apr 10, 2023
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Properly use the compositeAlignmn flag in the alignment driver Error Creating Alignment Tree for 2016 Data
3 participants